F-4EJs replaced the JASDF's fleet of Lockheed F-104J Starfighters. McDonnell Douglas built the two prototype F-4EJs (17-8301 and 17-8302), which first flew on 14 January 1971. These prototypes were delivered to Gifu Air Base in March 1971. The next 11 aircraft were assembled in Japan and the first Japanese-built example flew on 12 May 1972. Mitsubishi built all the EJs over the next nine years and the production ended with 127th F-4EJ (17-8440), on 20 May 1981. This was the last F-4 built in the world. Fourteen RF-4Es were delivered between November 1974 and June 1975. These were similar to the RF-4C, but, as for the F-4EJs, Japanese-built radar warning receivers and other equipment were substituted to replace equipment which was not released for export to Japan. The F-4EJ entered service with the JASDF in August 1972 with a total of six Hikōtai ("Squadrons") operating the aircraft: the 301, 302, 303, 304, 305 and 306th. The RF-4E equipped the 501st, that had previously operated one of the less-well-known Sabre models, the RF-86F. Japanese procurement involved small, multi-year orders, which made for slow production of small batches ordered every year. As of 2007, Japan has a fleet of 90 F-4s currently in service. Talks were underway to replace them with Eurofighter Typhoon aircraft, since the sale of the American F-22 Raptor was blocked by U.S. export restrictions. In June 2007, Lockheed Martin announced that the company has been awarded a contract to equip several F-15 Eagles with synthetic aperture radar pods. These F-15s will be used in a reconnaissance role, allowing the RF-4E and RF-4EJ to be retired; the F-4 having served from the 1970s into the 21st century. On 9 March 2020, the RF-4 was retired after 45 years in JASDF service. A four-ship flight of RF-4Es and RF-4EJs from 501st Hikōtai performed a ceremonial flypast, which included aircraft serial 47-6901, the first RF-4E built for Japan and the first to be handed over. This left 301st Hikōtai flying F-4EJ Kai models as the last remaining squadron equipped with Phantoms in Japan. 301st Hikōtai continued to operate the F-4EJ until 14 December 2020 when the Phantom was withdrawn from front-line service, remaining in use with the Air Development and Test Wing at Gifu. The final JASDF Phantoms were retired on 17 March 2021. Upgrades To upgrade the Phantom fleet the JASDF planned the F-4EJ Kai (Japanese for "modified") program. This