A method of determining an overlay error between a first pattern on a surface of a substrate and a second pattern superimposed on the first pattern, the first pattern comprising a first grating and the second pattern comprising a second grating on top of the first grating, the second grating having substantially identical pitch (P') as the first grating, the second and first gratings forming a composite grating, the method comprising: either: (i) providing a first illumination beam for illuminating at least the composite grating on the substrate under an angle of incidence (β) such that the first illumination beam propagates along a direction that has a component along a first horizontal direction along the surface of the substrate, the substrate being in a fixed position, and providing a second illumination beam for illuminating at least the composite grating on the substrate under the angle of incidence (-β) such that the second illumination beam has a component along a second horizontal direction along the surface of the substrate, wherein the second horizontal direction is opposite the first direction, the substrate being in the fixed position; or (ii) providing a first illumination beam and a second illumination beam for illuminating at least the composite grating on the substrate, each beam being provided under substantially normal incidence to the composite grating, the substrate being in the fixed position; characterized by blocking beams diffracted from the composite grating of diffraction order other than the first diffraction order (B+) when providing the first illumination beam, and blocking beams diffracted from the composite grating of diffraction order other than the minus first diffraction order (B-) when providing the second illumination beam; the method further comprising measuring a first intensity (I+) of the first order diffracted beam from the composite grating, the measuring of the first intensity comprising detecting an image of the composite grating obtained by only the first order diffracted beam by a pattern recognition method, and measuring a second intensity (I-) of the minus first order diffracted beam from the composite grating, the measuring of the second intensity comprising detecting an image of the composite grating obtained by only the minus first order diffracted beam by a pattern recognition method. either: (i) providing a first illumination beam for illuminating at least the composite grating on the substrate under an angle of incidence (β) such that the first illumination beam propagates along a direction that has a component along a first horizontal direction along the surface of the substrate, the substrate being in a fixed position, and providing a second illumination beam for illuminating at least the composite grating on the substrate under the angle of incidence (-β) such that the second illumination beam has a component along a second horizontal direction along the surface of the substrate, wherein the second horizontal direction is opposite the first direction, the substrate being in the fixed position; or (ii) providing a first illumination beam and a second illumination beam for illuminating at least the composite grating on the substrate, each beam being provided under substantially normal incidence to the composite grating, the substrate being in the fixed position; (ii) providing a first illumination beam and a second illumination beam for illuminating at least the composite grating on the substrate, each beam being provided under substantially normal incidence to the composite grating, the substrate being in the fixed position; characterized by blocking beams diffracted from the composite grating of diffraction order other than the first diffraction order (B+) when providing the first illumination beam, and blocking beams diffracted from the composite grating of diffraction order other than the minus first diffraction order (B-) when providing the second illumination beam; the method further comprising measuring a first intensity (I+) of the first order diffracted beam from the composite grating, the measuring of the first intensity comprising detecting an image of the composite grating obtained by only the first order diffracted beam by a pattern recognition method, and measuring a second intensity (I-) of the minus first order diffracted beam from the composite grating, the measuring of the second intensity comprising detecting an image of the composite grating obtained by only the minus first order diffracted beam by a pattern recognition method.