To irradiate a laser beam appropriately onto a patients eye. An ophthalmic apparatus having a laser irradiation optical system irradiating a laser beam for corneal surgery onto the eye, which performs alignment of a reference axis of the optical system to have a predetermined positional relationship with the eye to perform laser irradiation, includes movement means changing inclination and a position of the optical system with respect to the eye, first and second image-pickup means picking up anterior-segment images having image-pickup optical axes arranged in different directions and to have predetermined positional relationships with the reference axis, detection means for detecting inclination and a position of the eye with respect to the reference axis by subjecting the images by the image-pickup means to image processing, and control means controlling the movement means to bring the reference axis to an intended alignment state with the eye based on a detection result.