A cam angle sensor attaching structure for an internal combustion engine, comprising: a cylinder head with an intake side wall and an exhaust side wall, the intake side wall being formed with an air inlet to suck in an air, the exhaust side wall being formed with an exhaust outlet through which an exhaust gas is discharged; a camshaft (16, 17) extending along a cylinder bank direction, being rotatably supported on the cylinder head; a cylinder head cover and an EGR housing portion both of which are attached to the cylinder head so as to cover an upper portion of the cylinder head; and a cam angle sensor (31, 32) to detect a rotational angle of the camshaft (16, 17), wherein the EGR housing portion includes: a first side wall located on the same side as the exhaust side wall of the cylinder head; a second side wall located on the same side as the intake side wall of the cylinder head; a third side wall interconnecting end portions of the first and second side walls (25A, 25B) in the cylinder bank direction; an upper wall with a tubular boss portion (28A, 28B) to which the cam angle sensor (31, 32) is attached, the upper wall being connected to upper end portions of the first to third side walls (25A, 25B, 25C); and a tubular EGR passage portion with an EGR passage through which an EGR gas flows, the EGR passage portion being located on the same side as the third side wall, the EGR passage portion includes: an EGR gas inlet formed at the first side wall, to introduce the EGR gas into the EGR passage; and an EGR gas outlet formed at the second side wall, to discharge the EGR gas from the EGR passage, and the boss portion (28A, 28B) is connected to the EGR passage portion. a cylinder head with an intake side wall and an exhaust side wall, the intake side wall being formed with an air inlet to suck in an air, the exhaust side wall being formed with an exhaust outlet through which an exhaust gas is discharged; a camshaft (16, 17) extending along a cylinder bank direction, being rotatably supported on the cylinder head; a cylinder head cover and an EGR housing portion both of which are attached to the cylinder head so as to cover an upper portion of the cylinder head; and a cam angle sensor (31, 32) to detect a rotational angle of the camshaft (16, 17), wherein the EGR housing portion includes: a first side wall located on the same side as the exhaust side wall of the cylinder head; a second side wall located on the same side as the intake side wall of the cylinder head; a third side wall interconnecting end portions of the first and second side walls (25A, 25B) in the cylinder bank direction; an upper wall with a tubular boss portion (28A, 28B) to which the cam angle sensor (31, 32) is attached, the upper wall being connected to upper end portions of the first to third side walls (25A, 25B, 25C); and a tubular EGR passage portion with an EGR passage through which an EGR gas flows, the EGR passage portion being located on the same side as the third side wall, a first side wall located on the same side as the exhaust side wall of the cylinder head; a second side wall located on the same side as the intake side wall of the cylinder head; a third side wall interconnecting end portions of the first and second side walls (25A, 25B) in the cylinder bank direction; an upper wall with a tubular boss portion (28A, 28B) to which the cam angle sensor (31, 32) is attached, the upper wall being connected to upper end portions of the first to third side walls (25A, 25B, 25C); and a tubular EGR passage portion with an EGR passage through which an EGR gas flows, the EGR passage portion being located on the same side as the third side wall, the EGR passage portion includes: an EGR gas inlet formed at the first side wall, to introduce the EGR gas into the EGR passage; and an EGR gas outlet formed at the second side wall, to discharge the EGR gas from the EGR passage, and the boss portion (28A, 28B) is connected to the EGR passage portion.