WASHINGTON — The Senate voted Tuesday to raise the government’s debt ceiling and cut trillions of dollars from its spending, concluding a long and fractious partisan battle just hours before the government’s borrowing authority was set to run out.

The bill, which passed 74 to 26, was immediately signed by President Obama, who took a final shot at his Republican opposition for what he called a manufactured — and avoidable — crisis. “Voters may have chosen divided government,” he said, “but they sure didn’t vote for dysfunctional government.”

Voters will render their verdicts on the merits of divided government next year, but its impact is now abundantly clear: the agenda of the 112th Congress will be dominated by continuous fighting over spending priorities and regulation, with a high bar for big debates on foreign policy and other domestic issues coming to the fore.

“When was the last time anybody said anything about Libya?” said Representative Phil Gingrey, a Republican from Georgia who was first elected in 2002. “This is the way it is going to be until the election.”