WASHINGTON — A bill allowing the U.S. government to keep borrowing money for at least a few more months, beyond its record $16.4 trillion debt limit, won final congressional approval on Thursday, clearing the way for President Barack Obama to sign it into law.

The Democratic-led Senate passed the bill, 64-34, a week after the Republican-controlled House oapproved it, 285-144. Both votes were bipartisan.

“I am pleased that the House and the Senate were able to reach an agreement on the debt limit that not only avoids defaulting on our nation’s obligations, but that sets the Senate up to proceed with the creation of a budget for the first time in four years and holds us accountable if we don’t follow through,” said Sen. Angus King, I-Maine.

The legislation would put off until at least May 19 a showdown over the debt limit between Republicans, who demand more spending cuts to shrink deficits, and Democrats, who favor reducing deficits with a mix of spending cuts and tax hikes.

McConnell opposed the bill because it did not contain spending cuts, spokesman John Ashbrook said. “What’s needed now is a long-term solution to Washington’s out-of-control spending and debt,” Ashbrook said.

Senate Democratic leader Harry Reid said passage of the bill shows Washington will not engage “in another irresponsible debate about whether the United States government should pay its bills.”

Drafted by House Republican leaders, the bill marks a major retreat from their vow to use the debt limit to extract more spending cuts. A fight over the debt limit in August 2011 led to a downgrade in the U.S. government’s credit rating and sent markets tumbling.

By suspending enforcement of the debt limit, expected to be reached as early as mid-February, the government would keep borrowing money and paying its bills until at least May 19, when the limit would again be enforced.

Under the bill, the debt limit would have to be reset on May 19 to whatever level the debt reaches by then, likely about $17 trillion.

The president has refused to negotiate on the debt limit.

Several other budget skirmishes are likely over the next five weeks. Congress must consider what to do about automatic budget cuts set for the beginning of March and a measure to continue funding the operations of the government that must be in place by March 27.

In the past two years, House Republicans have drawn the wrath of many voters and financial markets for pushing the government to the brink of a shutdown and an unprecedented default.

Many Republicans have said they want to avoid either scenario this year. But they are also demanding more spending cuts and insist they will not go along with tax hikes.

Republicans have pushed for changes in major entitlement programs, such as Medicare and Social Security, to extract savings.

Obama promised to protect both programs, but has voiced a willingness to make some changes.

The debt limit bill requires both the House and Senate to pass a budget by April 15. The Senate hasn’t approved one in nearly four years, drawing complaints from Republicans that this has made it more difficult to find common ground on possible spending cuts.

The bill states that if either chamber fails to pass a bill by the April deadline, its members will not be paid. Republicans named the measure, “No Budget, No Pay Act of 2013.”

House Speaker John Boehner, the top U.S. Republican, issued a statement shortly after the Senate vote, urging the chamber to approve a budget.

“Our shared goal should be to help grow the economy and expand opportunity,” Boehner said. “To do that, we need to budget responsibly.”