By Richard Cowan and Steve Holland
WASHINGTON (Reuters) - U.S. President Donald Trump on Wednesday edged toward backing a deal in Congress on funding for a barrier on the Mexican border, but left open the possibility that disputes over the wall could still cause a partial government shutdown by the weekend.
Trump, widely blamed for a five-week shutdown that ended in January, said he did not want to see federal agencies close again because of fighting over funds for the wall, one of his signature campaign promises in the 2016 election.
But the Republican president fell short of committing himself to backing the congressional deal, which would keep the government open but not give Trump the $5.7 billion he seeks for the wall.
"I don't want to see a shutdown. A shutdown would be a terrible thing. I think a point was made with the last shutdown. People realized how bad the border is, how unsafe the border is, and I think a lot of good points were made," Trump told reporters.
Two sources said Trump will likely approve the funding agreement, but the president said he would hold off on a decision until he sees actual legislation about the issue. He warned lawmakers against "land mines," or parts of the bill he may not like.
"We haven't gotten it (the legislation) yet. We'll be getting it. We'll be looking for land mines," Trump said.
With a Friday night deadline looming before a shutdown, that leaves little time for the White House and the political parties in Congress to agree on funding.
The congressional agreement, reached by negotiators on Monday night, falls far short of giving Trump all the money he wants to help build the wall. Instead, congressional sources say, it includes $1.37 billion for new barriers - about the same as last year - along 55 miles (90 km) of the border.
Details of the legislation were still being written, but the full bill could be made public as early as Wednesday evening, according to lawmakers and congressional aides.
The accord must be passed by the House of Representatives, dominated by Democrats, and the Republican-controlled Senate, then signed by Trump by midnight on Friday to prevent a shutdown.
The measure's fate in the House was far from certain given the risk that some conservatives and liberals will oppose the compromise for different reasons.
Like Trump, congressional Republicans have little appetite for a repeat of the 35-day partial shutdown in December and January - the longest in U.S. history - which closed about a quarter of federal agencies and left some 800,000 federal workers without pay.
"It’s time to get this done,” Senate Majority Leader Mitch McConnell said on the Senate floor on Wednesday, in reference to voting on the compromise.
Democrats in the House are aiming to schedule a vote on Thursday evening, Majority Leader Steny Hoyer, a Democrat, told reporters. If passed, it would then go to the Senate on Friday.
A White House spokeswoman, Mercedes Schlapp, told CNN that lawyers were reviewing the administration's options should Congress not provide Trump's demanded money for the wall.
The Washington Post, citing a White House official, said Trump was likely to explore using his executive power to reallocate other federal funds for barrier projects along the southern border. CNN, citing the White House, also said Trump was weighing the use of an executive order, among other options.
Trump previously threatened to declare a "national emergency" if Congress did not provide money specifically for the wall - a move that would almost certainly draw opposition in Congress and in the courts.
"We think the president would be on very weak legal ground to proceed," said Hoyer, the No.2 Democrat in the House.
Trump has come in for criticism from the right for wavering on support for the border wall, which the administration says will cut illegal immigration and drug smuggling.
"Trump talks a good game on the border wall, but it's increasingly clear he's afraid to fight for it," right-wing commentator Ann Coulter tweeted on Tuesday. Trump abandoned a planned compromise on funding for the wall in December after similar criticism.
(Reporting by Richard Cowan and Susan Cornwell; Additional reporting by Roberta Rampton, Amanda Becker, Susan Heavey and Lisa Lambert; Writing by Alistair Bell; Editing by Jeffrey Benkoe and Jonathan Oatis)