Telling the story of a group of US naval aviators at a specialist fighter pilot school in San Diego, 1986’s Top Gun kick-started director Tony Scott’s long career, established Tom Cruise as both an action hero and leading man, and all but launched the careers of his co-stars, Kelly McGillis and Val Kilmer. An unexpected box office smash that grossed more than twenty times its $15 million budget, the movie became the most successful of the year—even its soundtrack (which included the 1987 Best Original Song Oscar winner, Berlin’s Take My Breath Away) went on to be certified nine-times platinum, and remains one of the biggest-selling soundtracks in cinema history.

What few people know about Top Gun, however, is that the flight school where it is set— the United States Navy’s Fighter Weapons School, at the Naval Air Station Miramar in San Diego—is a real place. And what even fewer people know is that the filmmakers were only allowed to involve a genuine military flight school thanks to the help and involvement from the United States Pentagon.

According to a 2011 The Washington Post article, when the filmmakers initially approached the Pentagon for help on the movie in 1985, the Pentagon agreed to lease out several major pieces of military ordinance, aircraft carriers, and fighter jet equipment for a fee of just under $2 million. In return, the Pentagon worked closely with the producers of Top Gun to ensure that what was portrayed on screen was a true to life as possible—and, more importantly, that it showed the workings of the United States military in a nothing but a positive light.

That condition meant that the producers were forced to send their script to Pentagon officials ahead of production, for them to vet (or veto) it line by line, and ensure that the story did not stray into controversial or critical territory. Only once the Pentagon’s modifications were either acted upon or okayed was production finally able to begin in San Diego in 1985.