After almost three days of gridlock in Congress that kept the US government closed in the first shutdown since 2013, the Senate and the House voted on Monday to allocate funding through February 8 and start negotiations on issues related to immigration and spending. Following intense talks between the Republican and Democratic leaderships as well as with a group of 20 bipartisan senators, the Senate approved a deal that paves the way to ending the shutdown that started on Friday at midnight. The vote gained the support of 81 senators, way above the mark of 60 that was needed to pass – but there were 18 members opposed to it. Those who voted against the measure included Democratic senators Bernie Sanders, Kirsten Gillibrand, Cory Booker, Kamala Harris and Elizabeth Warren – all are presidential hopefuls for 2020. Their gamble is that a vote against allocating funding for the Trump administration before agreeing to a solution on immigration measures would play well with the party’s progressive base. The House then voted 266 to 150 to extend federal funding. “I know there’s great relief that this episode is coming to an end,” House Speaker Paul Ryan told colleagues on the House floor. “But this is not a moment to pat ourselves on the back. Not even close.” For moderates in both parties, however, the continuation of the shutdown was proving to be detrimental on the basic functions of government. Hundreds of thousands of federal employees were granted leave of absence due to the crisis and didn’t come to work on Monday, mourning military families did not get paid, and federal contractors may see their payments delayed. Impact was also likely to knock on to other agencies who work in the defence sector, and tax preparations prompted swift action to end the shutdown. President Donald Trump welcomed the deal, saying: “I am pleased that Democrats in Congress have come to their senses and are now willing to fund our great military, border patrol, first responders, and insurance for vulnerable children. As I have always said, once the government is funded, my administration will work toward solving the problem of very unfair illegal immigration. We will make a long-term deal on immigration if, and only if, it is good for our country.” The Democratic leader in the Senate, Chuck Schumer, laid out the agreement that reopens the government, in return for a Republican commitment to vote on Daca (deferred action for childhood arrivals) which is also known as the Dream act. Democrats are seeking a vote to renew protections for Dreamers - a group of 690,000 undocumented immigrants who came to the US as children with their parents and face potential deportation after Mr Trump ended the Daca programme last September. “We will vote today to reopen the government to continue negotiating a global agreement, with the commitment that, if an agreement isn’t reached by February 8, the Senate will immediately proceed to the consideration of legislation dealing with Daca immediately after the expiration of the bill,” Mr Schumer said. The negotiations to reach the Senate vote were fraught, with both sides trading blame and accusations, and with Mr Trump’s first anniversary as president being overshadowed by government dysfunction. The US president took a back seat in the negotiations aside from his tweets, and a meeting with Mr Schumer on Friday. With the vote expected later in the House today, Mr Trump can resume his public schedule and go ahead with his trip to Davos on Thursday to participate in the World Economic Forum. As far as winners from the current deal, it appeared that the US federal employees, the group of 20 bipartisan senators, who negotiated the agreement and recipients of Children’s Health Insurance Programme (Chip) that was reauthorised for six years, have much to gain. Washington bars, however, that adjusted their menus and hours to attract Congressional staffers during the shutdown will have to wait for the next crisis: It remains unclear where the negotiations will lead in Congress on Daca after February 8, and if a bill that passes the Senate then will get approval in the House or more importantly by the White House. But for now, Mr Trump has averted a longer crisis; past shutdowns lasted 21 days in 1995 under Bill Clinton, and 16 days in 2013 under Barack Obama.