Disclosed herein are an X-ray imaging apparatus which recognizes a marker located at a part to be subjected to X-ray imaging from an image of a subject imaged by a camera and which controls a respective movement of each of an X-ray tube and an X-ray detector to a respective position which corresponds to the recognized marker, and a method for controlling the same. An X-ray imaging apparatus includes an X-ray tube which radiates X-rays toward a subject, an X-ray detector which detects X-rays which propagate through the subject, an imaging unit which generates an image of the subject, a recognizer which recognizes a part to be subjected to X-ray imaging from the image of the subject, and a position controller which controls a movement of the X-ray tube and the X-ray detector to a position corresponding to the part to be subjected to X-ray imaging.