Director George Lucas filmed much of the 1977 blockbuster “Star Wars” in North Africa and the U.K., but to get one of the key shots in the film, the production turned to Death Valley National Park in California.

The reason? Lucas needed an elephant.

Ahead of the Dec. 15 launch of the highly anticipated Walt Disney Co. DIS, +1.43% film “Star Wars: The Last Jedi,” MarketWatch decided to take a trip into the past and, through the Freedom of Information Act, discover a bit about what the U.S. government knew about the original “Star Wars” trilogy. One of the tidbits of information contained in 40-year-old National Park Service documents was that Lucas couldn’t film a critical scene involving an elephant in the North African country of Tunisia, where much of the shooting for the desert planet of Tatooine took place.

Watch: Luke Skywalker returns to the Millennium Falcon in new trailer for ‘Star Wars: The Last Jedi’

Documents that the National Park Service turned over to MarketWatch include several photographs from production, as well as permit applications, a pamphlet that offers parkgoers a guided tour of the filming locations and a letter to the California Highway Patrol outlining how the production planned to film one of the scenes.

The original ‘Star Wars’ letterhead. National Park Service

Lucas elected to shoot much of “Star Wars” at Elstree Studios in the United Kingdom, as well as in the deserts of Tunisia. Specifically attracted to the architecture in the Tunisian towns of Djerba, Matmata and Tataouine, the key scenes shot through 1976 in those locations would supply the setting for the planet Tatooine, named after the third town at which Lucas viewed, according to the documents.

As Lucas was running out of time and money overseas, he elected to gather critical footage — sound was added later — at Death Valley during the winter of 1977.

“Pre-production and the whole filming was very, very rushed,” said J.W. Rinzler, author of “The Making of Star Wars: The Definitive Story Behind the Original Film.” “Twentieth Century Fox didn’t give them the green light until Jan. 1 of 1975, and they had almost no pre-production time. George had to pay for pre-production out of his profits from ‘American Graffiti.’”

The national park offered necessary scenery: sand dunes, salt flats and rugged desert canyons that were close together. And to show the Tusken Raiders riding their banthas, Lucas needed an elephant, which was only possible in the U.S., according to the NPS documents.

An elephant dressed up as a bantha, which Tusken Raiders use to travel. National Park Service

Rinzler said that in addition to the insufficient time budgeted in Tunisia, there was also a large storm that curtailed filming. “Even if they could have gotten an elephant there, there wasn’t enough time,” he said in a telephone interview with MarketWatch.

The Death Valley scenes in “Star Wars” are short, lasting only a few seconds, sometimes less. But the National Park Service documents say that the footage, shot in five different locations around the park, was necessary for transitions between scenes that were critical for the film.

Mardji, the elephant Lucas used to film “Star Wars” at Death Valley. National Park Service

Lucas ended up using an elephant named Mardji from the Marine World Africa USA amusement park in Redwood City, Calif., and said later he felt a deep connection and “fell in love” with the elephant, said Rinzler. After the filming, Lucas would visit Mardji at Marine World, and even used the elephant’s gait as a model for the movement of the AT-AT Imperial walkers that assaulted the Rebel Alliance base on the ice planet Hoth in the sequel, “Star Wars: The Empire Strikes Back.”

Lucas returned once more to Death Valley in December 1982 to shoot a scene for “Star Wars: Return of the Jedi.”

The crew from “Star Wars” sets up a shot in Death Valley. National Park Service

In addition to the production images, the National Park Service turned over several documents that Lucas and his team generated in order to obtain the proper permits as well as a request to the California Highway Patrol to assign an officer for the filming of the scene. In the letter to the CHP, production manager Peter Herald outlined how the production planned to mount a modified Volkswagen on a “small low-bed trailer” that was towed by another vehicle, “probably a station wagon,” the document said.

Excerpt from letter to the CHP from production manager Peter Herald. National Park Service

Rinzler said that these documents almost certainly refer to Luke Skywalker’s landspeeder, which makes several appearances on Tatooine in the film. He said that Lucas went through several iterations of the vehicle — including a smaller version mounted on a carousel-type object so that it could be pushed around and look like it was hovering.

But the original landspeeder wasn’t designed in time to use while shooting in Tunisia — which was one more reason why Lucas needed to shoot several scenes at Death Valley.

The modified-Volkswagen landspeeder used in Death Valley was a much different iteration than the original concept because Lucas needed a shot looking down from on top of a cliff, and the vehicle needed to look like it was moving, Rinzler says. To make it appear like it was hovering, the crew mounted glass mirrors on the sides, reflecting onto the ground, which gave it a hovering effect in-camera.

“Ultimately in-camera effects look more real than certain special effects,” Rinzler said.

Excerpt from production manager Peter Herald letter to the California Department of Transportation. National Park Service

In the four decades since its initial release, “Star Wars” has become an international phenomenon, as the eighth film installment in the series is poised for release. But in 1977, Hollywood executives had little faith that a then-unknown director responsible only for an indie hit was capable of turning out a blockbuster, or even a break-even success. Fox FOX, +0.22% , the studio behind “Star Wars,” and its executives didn’t “understand the script” and even tried to sell it to a German company once they had a print rather than screen it in the U.S., Rinzler said.

Once released in 1977, “Star Wars" became the highest-grossing film ever, to that point. In September 1977, Lucas incorporated Lucasfilm Ltd., which owns the “Star Wars” franchise. In 2012, Lucas sold the business to Disney for $4.05 billion in cash and stock.

Disney’s stock, which slipped 0.5% in morning trade Monday, has rallied 12.9% over the past three months, while the Dow Jones Industrial Average DJIA, +0.51% has gained 11.1%.