President Donald Trump has signed a bill to end a 35-day-old partial US government shutdown without getting the $US5.7 billion he had demanded from Congress for a border wall, handing a political victory to Democrats.

The three-week spending deal reached with congressional leaders, quickly passed by the Republican-led Senate and the Democratic-controlled House of Representatives without opposition and signed by Trump, paves the way for tough talks with lawmakers about how to address security along the US-Mexican border.

Camera Icon House Speaker Nancy Pelosi signs a deal to reopen the government. Credit: AP

Play Video Transportation Security Agency workers say they're relieved they will soon be getting their missed paychecks now that the government shutdown is over. But they also say they're worried that another shutdown could occur in a few weeks. The West Australian Video Transportation Security Agency workers say they're relieved they will soon be getting their missed paychecks now that the government shutdown is over. But they also say they're worried that another shutdown could occur in a few weeks.

The Republican president’s agreement to end the shuttering of about a quarter of the federal government without securing wall money - an astonishing retreat - came three days after he had insisted, “We will not Cave!”

But Trump vowed that the shutdown would resume on February 15 if he is dissatisfied with the results of a bipartisan House-Senate conference committee’s border security negotiations, or he would declare a national emergency in order to get the wall money without congressional approval.

“Let me be very clear: we really have no choice but to build a powerful wall or steel barrier,” Trump said.

Camera Icon Transportation Security Administration officers smile moments after President Donald Trump announced a deal to reopen the federal government. Credit: AP

The lapse in funding shuttered about a quarter of federal agencies, with about 800,000 workers either furloughed or required to work without pay.

Many employees as well as contractors were turning to unemployment assistance, food banks and other support. Others began seeking new jobs.

With polls showing most Americans blamed him for the painful shutdown - the longest of its kind in US history - Trump embraced a way out of the crisis that Democratic House Speaker Nancy Pelosi had been pushing for weeks.

The shutdown, which pitted Pelosi against Trump, was her first test since assuming the post three weeks ago. She drew praise from fellow Democrats for what they said was an outmanoeuvring of the president.

Camera Icon House Speaker Nancy Pelosi smiles as reporters ask questions during a news conference on Capitol Hill in Washington. Credit: AP

Democrats remained unyielding in their opposition to a wall, one of Trump’s signature campaign promises that they call ineffective, costly and immoral. Trump has said a wall is needed to curb illegal immigration and drug trafficking.

Asked by reporters if she could guarantee there will not be another government shutdown in three weeks, Pelosi said, “I can’t assure the public about anything that the president will do, but I do have to say I’m optimistic.”

Speaking in the White House Rose Garden on a chilly, sunny winter day, Trump said he would act to ensure that federal workers get their back pay “very quickly, or as soon as possible”.

Camera Icon President Donald Trump leaves the podium after announcing that a deal has been reached to reopen the government. Credit: PA

Trump had previously demanded the inclusion of the money to help pay for a wall in any legislation to fund government agencies, but Democrats had blocked him.

An administration official, speaking on condition of anonymity, said that stories of law enforcement officials not being able to do their jobs at full capacity helped convince Trump to agree to a short-term solution to re-open the government.

Conservative commentator Ann Coulter lashed out at Trump for capitulating on Friday, calling him on Twitter “the biggest wimp ever to serve as President of the United States”.

Trump took to Twitter to say his about-face was “in no way a concession” and that he was simply “taking care of millions of people who were getting badly hurt by the Shutdown”.