Disclosed herein are an X-ray imaging apparatus and a method of controlling the same. The X-ray imaging apparatus includes an X-ray emitter to irradiate an object with X-rays and be movable, an X-ray detector to detect X-rays having passed through the object, convert the detected X-rays into an electric signal, and be movable, a location information collector to collect location information regarding the object, and a controller to control the X-ray emitter or the X-ray detector based on the location information regarding the object collected by the location information collector.