WASHINGTON — Congressional leaders agreed to an 11th-hour tentative deal late last night on about $39 billion in budget cuts, a breakthrough that represents the largest retrenchment in spending in American history and spotlights the Tea Party movement’s strength beyond the Republican Party.

The agreement followed weeks of partisan finger-pointing, a series of stopgap spending resolutions to keep the government afloat, and days of round-the-clock negotiations. House Speaker John Boehner, Republican of Ohio, and Senate majority leader Harry Reid, Democrat of Nevada, signed off on it about an hour before the government would have run out of money, throwing about 800,000 federal employees out of work temporarily.

“It has not been an easy process,’’ Reid said. “Both sides have had to make tough choices. This is historic what we’ve done.’’

As the deal was confirmed, Reid and Boehner rushed a six-day spending measure to the floors of the Senate and House to halt the shutdown and buy members time to digest, debate, and vote on the agreement. Both chambers passed the stopgap bill, with the House finishing voting in the early morning.

To reach the level of cuts in the deal, Republicans backed down from their insistence that the government halt funding for Planned Parenthood. A Senate aide said the bill would ban funding for abortion in the District of Columbia, but Congress would vote separately on whether to halt funding for Planned Parenthood.

That vote was expected to fail.

The legislation also would not contain provisions blocking regulation of greenhouse gases, another obstacle in the process, the aide said.

For Boehner, the deal represented the best Republicans could get.

“We fought to keep government spending down,’’ Boehner said.

President Obama said Americans had to begin to live within their means.

“Programs people rely on will be cut back,’’ he said. “Needed infrastructure projects will be delayed.’’

It was unclear, however, whether the agreement would cut deeply enough for conservative Republicans or would do enough to protect domestic programs for liberal Democrats.

One Republican said he would need to be convinced.

“I have to wait to hear what it is, but $39 billion is not what we pledged to do,’’ said Representative Louis Gohmert, a Texas Republican who has strong support from the Tea Party. “I’d have to hear something special to make up for what we pledged to do.’’

House Republicans, pushed by members such as Gohmert, had sought $61 billion in cuts for the bill, which would fund government operations through September. Democrats had agreed to about $10 billion in cuts as of early this week.