Joshua Roberts / Reuters

The U.S. Senate passed a bipartisan budget accord in the early morning hours on Friday, defusing a potential government shutdown and default on the national debt for the final time of the Obama presidency.

Senators cast their final votes for the legislation at 2:30 a.m. on Friday, passing it on a vote of 64-35. The deal, brokered between President Obama and congressional leaders from both parties earlier this week, will raise federal spending by $80 billion over the next two years and avoid a looming shutdown of the federal government on November 1. The accord also extends the nation’s debt limit, which Treasury Secretary Jack Lew had estimated would expire in less than a week, for two years until March 2017. The new limit will occur less than two months after a new president will be sworn into office.

The House of Representatives passed the bill earlier this week by a 266-167 margin. In what he described as “cleaning the stables” before his successor’s election on Thursday, the outgoing Speaker of the House John Boehner pushed the deal through that chamber on Wednesday with the support of moderate Republicans and the entire Democratic caucus, defying the conservatives who vexed him throughout his tenure.

Some senators bemoaned the missed opportunity to force deeper cuts in government spending, including GOP presidential hopefuls Rand Paul, Ted Cruz, and Marco Rubio, who voted against the bill. “This deal represents the worst of Washington culture,” Paul said on the Senate floor as the vote neared shortly after midnight. “The left gets more welfare, the right gets more military spending, and the taxpayer gets stuck with the bill.”

The Kentucky senator spoke for less than ten minutes before the Senate voted to limit debate, a far shorter time than his two previous filibusters that both lasted more than 12 hours, and for only an hour after cloture. As he spoke, some Democratic senators tweeted their frustrations about the late-night vote.

Senate leaders scheduled the late-night vote to reduce their colleagues’ incentive to prolong the process. Majority Whip John Cornyn, a Republican from Texas, hoped that “maybe they would decide it would be better to speak when people are actually paying attention.”

The bill’s passage ends an era of high-stakes brinksmanship between Republican leaders in Congress and Obama, which led to a near-default on the national debt in August 2011 and a shutdown of the federal government in October 2013.

We want to hear what you think about this article. Submit a letter to the editor or write to letters@theatlantic.com.