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 extending along a cylinder bank direction (A), 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 to detect a rotational angle of the camshaft , 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 in the cylinder bank direction (A); an upper wall with a tubular boss portion to which the cam angle sensor is attached, the upper wall being connected to upper end portions of the first to third side walls ; 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 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 extending along a cylinder bank direction (A), 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 to detect a rotational angle of the camshaft , 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 in the cylinder bank direction (A); an upper wall with a tubular boss portion to which the cam angle sensor is attached, the upper wall being connected to upper end portions of the first to third side walls ; 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 in the cylinder bank direction (A); an upper wall with a tubular boss portion to which the cam angle sensor is attached, the upper wall being connected to upper end portions of the first to third side walls ; 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 is connected to the EGR passage portion . <EOS>