PURPOSE: To reduce uncertainty due to setup error and organ motion during radiotherapy of tumors in or near the lung, by means of real-time tumor tracking and gating of a linear accelerator. METHODS AND MATERIALS: The real-time tumor-tracking system consists of four sets of diagnostic X-ray television systems (two of which offer an unobstructed view of the patient at any time), an image processor unit, a gating control unit, and an image display unit. The system recognizes the position of a 2.0-mm gold marker in the human body 30 times per second using two X-ray television systems. The marker is inserted in or near the tumor using image guided implantation. The linear accelerator is gated to irradiate the tumor only when the marker is within a given tolerance from its planned coordinates relative to the isocenter. The accuracy of the system and the additional dose due to the diagnostic X-ray were examined in a phantom, and the geometric performance of the system was evaluated in 4 patients. RESULTS: The phantom experiment demonstrated that the geometric accuracy of the tumor-tracking system is better than 1.5 mm for moving targets up to a speed of 40 mm/s. The dose due to the diagnostic X-ray monitoring ranged from 0.01% to 1% of the target dose for a 2.0-Gy irradiation of a chest phantom. In 4 patients with lung cancer, the range of the coordinates of the tumor marker during irradiation was 2.5-5.3 mm, which would have been 9.6-38.4 mm without tracking. CONCLUSION: We successfully implemented and applied a tumor-tracking and gating system. The system significantly improves the accuracy of irradiation of targets in motion at the expense of an acceptable amount of diagnostic X-ray exposure.