The United States’ second shutdown in three weeks ended on Friday, after the president signed a nearly $400bn funding bill that narrowly passed Congress only a few hours before.

Funding for the federal government had lapsed at midnight eastern time after Kentucky Republican Rand Paul stalled a Senate vote on a far-reaching budget agreement to fund the government through 22 March while also eliminating caps on government spending and suspending the debt ceiling for the year.

The shutdown lasted only a few hours, giving the Senate and the House time to pass the 600-page, funding bill.

The Senate voted early Friday morning, before sending the bill to the House where its future was less certain. The Senate approved the legislation by a bipartisan majority of 71-28. The House eventually voted to approve the bill at 5.30am by a margin of 240 to 186.

House Democrats, who had earlier threatened to derail the bill because it did not protect young immigrants, eventually gave Republicans the votes they did not have. There were 73 Democrats who voted for the legislation and 67 Republicans who voted against.

Donald Trump signed the two-year spending bill into law around 8.40am on Friday, tweeting: “Our military will now be stronger than ever before. We love and need our military and gave them everything – and more. First time this has happened in a long time.”

He also remarked on how Republicans struggled to wrangle their party for votes, requiring them to compromise with Democrats. “Without more Republicans in Congress, we were forced to increase spending on things we do not like or want in order to finally, after many years of depletion, take care of our Military,” he wrote. “Sadly, we needed some Dem votes for passage.”

The deal agreed to by Republicans and Democrats raises defense and non-defense spending by $300bn and provide billions of additional dollars in disaster relief funding for areas ravaged by wildfires and hurricanes last year. It would also lift the federal debt limit until March 2019, allowing the government to take on new debt for the next year.

The measure includes victories for the president, Republicans and Democrats. But perhaps above all, it offers Congress a measure of stability through September 2019, the end of the fiscal year, after months of lurching between financial crises and shutdowns.

Paul, whose one-man blockade forced the brief shutdown, objected to the fact that deal would result in a significant increase in the federal budget deficit without any corresponding cuts to spending.



He complained in an interview with Fox News: “I’m not advocating for shutting down the government.” Instead, Paul said: “I’m also not advocating for keeping the damn thing open and borrowing a million dollars a minute. This is reckless spending that is out of control.”

Senate rules only allowed the Kentucky Republican to block a vote until after 1am on Friday morning.

“The senator from Kentucky by objecting to the unanimous consent requests will effectively shut down the federal government, for no real reason,” John Cornyn, the number two Republican in the Senate, said in remarks on the floor.

Cornyn later expressed his deep discontent with his colleague to reporters. The Texas Republican called Paul’s actions “grossly irresponsible” and said he would not make concessions to the Kentucky Republican. “Why reward bad behavior?” asked Cornyn.

This disdain was shared by other Republicans. Roy Blunt of Missouri said of Paul’s actions, “this doesn’t really seem to have a point” while John Thune of South Dakota described it as “kind of a colossal waste of everybody’s time”.

The deal was long expected to have bipartisan support to pass in the Senate. However, it faced greater obstacles in the House of Representatives where a coalition of conservatives and liberals had united in opposition.

Conservatives, including the hard-right Freedom Caucus, were deeply opposed to the deficit spending in the bill. Liberals, including the Congressional Hispanic Caucus, were outraged that the proposal did not include any protection for “Dreamers,” undocumented immigrants brought to the United States as children who face potential deportation on 5 March.

House Democrats left a closed-door meeting on Thursday deeply divided over a path forward. Many members do not trust Paul Ryan’s assurance to bring an immigration bill to the floor and feared that they would lose any leverage to force a vote to protect young undocumented immigrants from deportation if they gave Republicans enough votes to pass the budget measure.

The House minority leader, Nancy Pelosi, planned to oppose the bill, and despite suggesting that she would not pressure her colleagues to follow suit, appeared to be doing just that.

House Democrats said Pelosi appealed to members to vote against the budget bill if Ryan did not provide a stronger commitment on immigration, though leaders did not formally whip the vote.

Pelosi has faced immense pressure from immigration activists and progressive lawmakers in her caucus to take a hardline for Dreamers, the young undocumented immigrants who could lose protections from deportation under a program that Donald Trump has rescinded.

Activists have staged large-scale protests and sit-ins demanding Democrats take a stand on immigration.

Democrats triggered a brief shutdown in January, and relented only after securing a promise from the Senate majority leader, Mitch McConnell, to allow a vote. Democrats in the House are seeking a similar commitment from Ryan.

Ryan said on Thursday he would bring an immigration bill to the floor that the president would sign. However, many Democrats, consider Trump’s views on immigration to be too draconian and are scarred by the House not voting on a 2013 immigration bill that was approved in the Senate by a bipartisan majority.