SpaceX, the rocket company founded by Elon Musk, is building spaceship prototypes at a launch site in southern Texas.

The site is less than 3 miles from the US-Mexico border and embroiled in President Donald Trump's push for a border wall.

Government maps reportedly show a proposed physical barrier running directly through SpaceX's site.

President Trump on Thursday said he will sign a nearly $1.4 billion border-security deal that excludes SpaceX's site from fencing.

However, Trump on Friday declared a national emergency to circumvent Congress and build more fencing that's not part of the agreement.

Elon Musk's aerospace company, SpaceX, is working around-the-clock to build a rocket-launch site at the southern tip of Texas.

Most immediately, SpaceX plans to fly a stainless-steel "test hopper" vehicle: a squat prototype for a much larger launch system that Musk calls Starship. When stacked together, a complete Starship spaceship and its Super Heavy rocket booster may stand about 39 stories high.

Firing off Starship to the moon or Mars from that site might be impossible, though, if a wall cuts across the launch facility: SpaceX's site is less than three miles from the US-Mexico border. Yet lawmakers said a physical barrier is precisely what proposed maps from the US Department of Homeland Security (DHS) showed, according to Bloomberg.

However, a $1.37 billion border-security agreement by a bipartisan group of lawmakers may spare SpaceX's facility from DHS bulldozers, thanks to a small section in the 1,159-page document.

"None of the funds made available by this Act or prior Acts are available for the construction of pedestrian fencing ... within or east of the Vista del Mar Ranch tract of the Lower Rio Grande Valley National Wildlife Refuge," states section 231 of the bill.

That wildlife refuge region encompasses SpaceX's 50-acre site launch site.

Read more: SpaceX's giant rocket ship was damaged by powerful winds in Texas — the nosecone blew over, and Elon Musk says repairs will take weeks

Though President Donald Trump is expected to sign the agreement into law, it remains to be seen if Musk's facility will be spared.

What SpaceX is doing in southern Texas

SpaceX's "test hopper," an experimental stainless-steel ship, in Texas. The person at the bottom is for scale. Elon Musk/SpaceX via Twitter

SpaceX began seriously exploring the South Texas launch site around 2012.

Documents filed by SpaceX suggest the company would annually launch up to 12 missions from the site per year: about 10 on the company's workhorse Falcon 9 rockets, and no more than two on Falcon Heavy — currently the world's most powerful operational rocket.

But during a May 2018 press briefing, Musk said the South Texas launch site "will be dedicated to" the upcoming Starship system (formerly called "Big Falcon Rocket"), and that other sites would launch Falcon 9 and Falcon Heavy.

Read more: SpaceX test-fired a Raptor rocket engine with 'insane power' for moon and Mars missions. The future of Elon Musk's company may ride on its unrivaled performance.

Now parts of the site, if not the entire area, is at risk of being taken over by the government, due to a Republican-led push for a border wall.

Trump campaigned on erecting a southern border wall, stating that Mexico would pay for the project. As President, he's pushed for about $5.7 billion of taxpayer funding for the physical barrier (and claimed Mexico would later reimburse the US).

Trump's latest push led to political deadlock and a 34-day partial shutdown of the US government in December and January — the longest in history. About two-thirds of Americans oppose funding a physical border, according to opinion poll data collected in early January.

The new bipartisan compromise does not come close to Trump's desired level of funding, and Trump said Wednesday that he is not happy with the deal, according to the Associated Press. On Thursday, Trump said he will sign the bill anyway, but by Friday morning he signed a national emergency declaration.

Why Musk's Mars launch site may still be at risk

SpaceX's Texas launch site is located just west of Boca Chica Beach and Brazos Island. Google Earth; Business Insider

In theory, declaring a national emergency will permit the Trump administration to circumvent congressional funding rules and reassign more than $6 billion from other government sources toward a border wall. Part of that diversion includes $3.6 billion earmarked for military construction projects, including housing for military families.

"I didn't need to do this," Trump said on Friday of the national emergency declaration, adding: "I just want to get it done faster."

Senate Majority Leader Mitch McConnell said on Thursday that he would "support the national emergency declaration."

Though the $1.37 billion in the new law can't be used to build fences over SpaceX's launch site, it's not yet clear if Trump's emergency funding (which is not part of the new law) could be used to do so.

The US government would first have to take over a series of properties owned by SpaceX. At least one lawyer views the use of eminent domain by way of Trump's emergency order as unlikely.

"The law does not permit the use of eminent domain under the emergency declaration provisions, and any attempt to seize private property will likely be frustrated by length court proceedings," Matthew Kolken, an immigration lawyer and an elected board member of the American Immigration Lawyers Association, told Business Insider.

SpaceX declined to comment on the proposed legislation.

US Congressman Henry Cuellar, a Democrat representing Texas' 28th district, claimed credit for getting the language into the new agreement that may ultimately protect SpaceX's interests.

"This is a big win for the Rio Grande Valley," Rep. Cuellar said in a statement emailed to Business Insider. "I worked hard to include this language because protecting these ecologically-sensitive areas and ensuring local communities have a say in determining the solutions that work for them is critical. I know we can secure the border in a much more effective way, and at a fraction of the cost, by utilizing advanced technology and increasing the agents and properly equipping them on the border."

Some fencing already exists near the SpaceX launch site in South Texas, but it "is full of gaps" that US Customs and Border Patrol agents and landowners "drive through daily," a former local government official told Business Insider.

Physical barriers are not all that guard the border in the area, though.

"There are sensors all over and they know when someone is going through," the official said. "The [Rio Grande] river below that is patrolled by boat, helicopter, drone, and monitored by the blimp."

John Haltiwanger contributed reporting to this story.

This story has been updated with new information. It was originally published on February 14, 2019.