In this work, three-dimensional (3D) motion of lung tumors during radiotherapy in real time was investigated. Understanding the behavior of tumor motion in lung tissue to model tumor movement is necessary for accurate (gated or breath-hold) radiotherapy or CT scanning. Twenty patients were included in this study. Before treatment, a 2-mm gold marker was implanted in or near the tumor. A real-time tumor tracking system using two fluoroscopy image processor units was installed in the treatment room. The 3D position of the implanted gold marker was determined by using real-time pattern recognition and a calibrated projection geometry. The linear accelerator was triggered to irradiate the tumor only when the gold marker was located within a certain volume. The system provided the coordinates of the gold marker during beam-on and beam-off time in all directions simultaneously, at a sample rate of 30 images per second. The recorded tumor motion was analyzed in terms of the amplitude and curvature of the tumor motion in three directions, the differences in breathing level during treatment, hysteresis (the difference between the inhalation and exhalation trajectory of the tumor), and the amplitude of tumor motion induced by cardiac motion. The average amplitude of the tumor motion was greatest (12 +/- 2 mm [SD]) in the cranial-caudal direction for tumors situated in the lower lobes and not attached to rigid structures such as the chest wall or vertebrae. For the lateral and anterior-posterior directions, tumor motion was small both for upper- and lower-lobe tumors (2 +/- 1 mm). The time-averaged tumor position was closer to the exhale position, because the tumor spent more time in the exhalation than in the inhalation phase. The tumor motion was modeled as a sinusoidal movement with varying asymmetry. The tumor position in the exhale phase was more stable than the tumor position in the inhale phase during individual treatment fields. However, in many patients, shifts in the exhale tumor position were observed intra- and interfractionally. These shifts are the result of patient relaxation, gravity (posterior direction), setup errors, and/or patient movement.The 3D trajectory of the tumor showed hysteresis for 10 of the 21 tumors, which ranged from 1 to 5 mm. The extent of hysteresis and the amplitude of the tumor motion remained fairly constant during the entire treatment. Changes in shape of the trajectory of the tumor were observed between subsequent treatment days for only one patient. Fourier analysis revealed that for 7 of the 21 tumors, a measurable motion in the range 1-4 mm was caused by the cardiac beat. These tumors were located near the heart or attached to the aortic arch. The motion due to the heartbeat was greatest in the lateral direction. Tumor motion due to hysteresis and heartbeat can lower treatment efficiency in real-time tumor tracking-gated treatments or lead to a geographic miss in conventional or active breathing controlled treatments. The real-time tumor tracking system measured the tumor position in all three directions simultaneously, at a sampling rate that enabled detection of tumor motion due to heartbeat as well as hysteresis. Tumor motion and hysteresis could be modeled with an asymmetric function with varying asymmetry. Tumor motion due to breathing was greatest in the cranial-caudal direction for lower-lobe unfixed tumors.