An image sensor equipped with imaging pixels arrayed in a two-dimensional square matrix pattern along a horizontal direction and a vertical direction, which converts an image formed through an optical system to an electrical signal, comprising: a plurality of first focus detection pixel groups (121, 122, 141, 142, 151-159, 171-179) each formed by disposing in the array of the imaging pixels a plurality of focus detection pixels along horizontal direction, in each of which a pair of first rangefinding pupils are set horizontally side by side, so as to receive light fluxes arriving from the pair of first rangefinding pupils; and a plurality of second focus detection pixel groups (111-119, 131-139, 161, 162, 181, 182) each formed by disposing in the array of the imaging pixels, a plurality of focus detection pixels along the vertical direction, in each of which a pair of second rangefinding pupils are set vertically side by side, so as to receive light fluxes arriving from the pair of second rangefinding pupils, wherein: when the image sensor is divided by two virtual straight lines (103, 104), intersecting at right angles to each other at an image plane centre and the two virtual straight lines are at 45° to the horizontal direction and to the vertical direction respectively, into four regions in which a first region and a second region are located horizontally opposite to each other with respect to the image plane centre, and a third region and a fourth region are located vertically opposite to each other with respect to the image plane centre, a plurality of said first focus detection pixel groups and a plurality of said second focus detection pixel groups are set in each of the four regions, in both of the first region and the second region, the second focus detection pixel groups (111-119, 131-139) are disposed in greater number than the first focus detection pixel groups (121, 122, 141, 142), while in the third region and the fourth region, the first focus detection pixel groups (151-159, 171-179) are disposed in greater number than the second focus detection pixel groups (161, 162, 181, 182). a plurality of first focus detection pixel groups (121, 122, 141, 142, 151-159, 171-179) each formed by disposing in the array of the imaging pixels a plurality of focus detection pixels along horizontal direction, in each of which a pair of first rangefinding pupils are set horizontally side by side, so as to receive light fluxes arriving from the pair of first rangefinding pupils; and a plurality of second focus detection pixel groups (111-119, 131-139, 161, 162, 181, 182) each formed by disposing in the array of the imaging pixels, a plurality of focus detection pixels along the vertical direction, in each of which a pair of second rangefinding pupils are set vertically side by side, so as to receive light fluxes arriving from the pair of second rangefinding pupils, wherein: when the image sensor is divided by two virtual straight lines (103, 104), intersecting at right angles to each other at an image plane centre and the two virtual straight lines are at 45° to the horizontal direction and to the vertical direction respectively, into four regions in which a first region and a second region are located horizontally opposite to each other with respect to the image plane centre, and a third region and a fourth region are located vertically opposite to each other with respect to the image plane centre, a plurality of said first focus detection pixel groups and a plurality of said second focus detection pixel groups are set in each of the four regions, in both of the first region and the second region, the second focus detection pixel groups (111-119, 131-139) are disposed in greater number than the first focus detection pixel groups (121, 122, 141, 142), while in the third region and the fourth region, the first focus detection pixel groups (151-159, 171-179) are disposed in greater number than the second focus detection pixel groups (161, 162, 181, 182).