WASHINGTON (AP) — President Donald Trump is edging closer to declaring a national emergency to pay for his long-promised U.S.-Mexico border wall as pressure mounts to end the three-week impasse that has closed parts of the government and deprived hundreds of thousands of workers of their salaries.

Some 800,000 federal employees, more than half still on the job, were due to miss their first paycheck Friday under a stoppage that neared a record for the longest government shutdown. With the closure’s growing impact on the economy, national parks and food inspections, some Republicans are becoming uncomfortable with Trump’s demands.

Lawmakers tried to reassure federal employees on Friday that Congress was aware of the financial hardship they are enduring. By a vote of 411-7, the House passed a bill requiring that all government workers receive retroactive pay after the partial shutdown ends. The Senate approved the bill unanimously Thursday. The president is expected to sign the legislation.

Trump visited McAllen, Texas, and the Rio Grande on Thursday to highlight what he calls a crisis of drugs and crime along the border. He said that “if for any reason we don’t get this going” — an agreement with House Democrats who have refused to approve the $5.7 billion he demands for the wall — “I will declare a national emergency.”

Trump was consulting with White House lawyers and allies about using emergency powers to take action on his own, and over the objections of Congress, to construct the wall. Bypassing Congress’ constitutional control of the nation’s purse strings would lead to certain legal challenges and bipartisan charges of executive overreach. Trump said his lawyers had told him the action would withstand legal scrutiny “100 percent.”

The wall was the central promise of Trump’s winning campaign in 2016. Supporters have tried to convince him that an emergency declaration is the best option to end the shutdown and would give him political cover to reopen the government without appearing to be caving on his pledge. Trump, they argue, could tell backers that he was doing all he could to fight for the wall, even if his order were held up or blocked in court.

But not everyone in the administration is on board.

Senior aide Jared Kushner, who traveled with the president to Texas, is among those urging caution on the declaration, according to a person familiar with Kushner’s thinking but not authorized to publicly discuss the issue.

Trump is growing more frustrated as the shutdown drags on and is complaining that his aides are not offering him an exit strategy.

In the meantime, the administration has taken steps to lay the groundwork should Trump issue the declaration.

The White House has directed the Army Corps of Engineers to comb through its budget in search of money for the wall, including looking at $13.9 billion in unspent disaster relief funds earmarked for areas including hurricane-damaged Puerto Rico, Texas and more than a dozen other states. That’s according to a congressional aide and administration official familiar with the matter who spoke on condition of anonymity because they were not authorized to speak publicly about the request.

Rep. Mark Meadows, R-N.C., a lawmaker with a close relationship with the president, discounted that option, saying it was not “under very serious consideration.”

“If there’s a list of top 10 priorities on where to get money from, that doesn’t make the top 10 list,” Meadows said.

Defense Department officials had already been poring over data on more than $10 billion in military construction projects to determine how much of it would be available for emergency spending this year.

On Friday, officials in Puerto Rico said diverting disaster money to the wall was “unacceptable” and that the island was struggling to recover from Hurricane Maria, the Category 4 storm that hit more than a year ago and caused more than $100 billion in damage

Gov. Ricardo Rossello said the wall should not be funded “on the pain and suffering” of U.S. citizens who have faced tragedy after a natural disaster.

It was not clear what a potential compromise between the White House and Congress might entail. Efforts at negotiating a broader immigration deal involving immigrants brought to the country illegally as children collapsed with little progress.

Sen. Lindsey Graham, R-S.C., said at one point that he didn’t “see a path in Congress” to end the shutdown, then stated later that enough was enough: “It is time for President Trump to use emergency powers to fund the construction of a border wall/barrier.”

During his Thursday trip, Trump insisted he was “winning” the shutdown fight and criticized Democrats for asserting he was manufacturing a sense of crisis in order to declare an emergency.

House Speaker Nancy Pelosi, D-Calif., accused the president of engaging in political games to fire up his most loyal supporters and suggested that a heated meeting Wednesday with legislators at the White House had been “a setup” so that Trump could walk out of it.

The partial shutdown would set a record early Saturday, stretching beyond the 21-day closure that ended Jan 6, 1996, during President Bill Clinton’s administration.