President Obama poses for photographers in the Blue Room at the White House in Washington after he spoke regarding the budget and averted government shutdown after a deal was made between Republican and Democrat lawmakers, Friday, April 8, 2011.

House Speaker John Boehner, center.

Surrounded by news media, House Speaker John Boehner, R-Ohio, far left, announces late Friday that an agreement to avert a government shutdown was reached. The agreement is expected to be voted on formally next week.

WASHINGTON — Congressional leaders agreed late Friday to a compromise that will keep the federal government funded for the remainder of the fiscal year, averting a government shutdown less than two hours before it was set to start.

House Speaker John Boehner, R-Ohio, announced the deal just before 11 p.m. EDT, after the agreement came together in a few frantic hours at the near-deserted Capitol, with a midnight deadline looming.

President Barack Obama hailed the deal as “the biggest annual spending cut in history.” House Speaker John Boehner said that over the next decade, it would cut government spending by $500 billion, and he won an ovation from his rank and file — Tea Party adherents among them.

“This is historic, what we’ve done,” said Senate Majority Leader Harry Reid, D-Nev., the third man involved in negotiations.

Boehner said that a short-term spending resolution would be approved to keep the government open into next week, and that the final agreement for the rest of the year would be approved by the middle of next week.

“The Washington Monument, as well as the entire federal government, will be open for business,” Obama said.

The final agreement, if approved, would cut $37.8 billion from the federal budget through the end of September, congressional aides said.

Democrats had wanted to cut billions less. They assented to the larger figure, and in return, Republicans dropped a demand to take federal funds from the group Planned Parenthood, according to aides in both parties.

The argument about federal funding for groups such as Planned Parenthood was a key sticking point, aides said, and it was really an argument about abortion.

Biggest budget cuts ever

The cuts, if enacted, would add up to the largest budget reduction for federal agencies in U.S. history. Some conservative Republicans had pushed for much more and grumbled about the compromise Friday.

But inside a few months, an ascendant Republican Party has managed to impose its small-government agenda on a town still largely controlled by Democrats.

“In democracy, you compromise,” said Rep. Darrell Issa, R-Calif., emerging from a caucus meeting after the deal was struck.

The budget agreement is not yet law. On Friday, there simply wasn’t time to make it legal before midnight.

Instead, lawmakers planned to rush through a stopgap measure, keeping the government open for several days while they work on the broader plan. The White House might also use its power to keep the government running for a short time while a stopgap is finalized.

Some conservatives have signaled that they would be unhappy with any compromise that offered a smaller spending reduction than the $61 billion the GOP-led House had passed.

But it’s unclear how widespread such unhappiness will be inside the GOP. Already, many Republicans have called for the party to end this fight and focus on a much more ambitious one over the 2012 budget. This week, the House Budget Committee approved a plan that, over 10 years, would save $6 trillion.

The fight over the 2011 budget “is the first bite of the apple,” said Rep. Paul Ryan, R-Wis., the Budget Committee chairman and the architect of that ambitious proposal. “We want to get billions in savings and then we want to move on to get trillions in savings.”

Battle over more than money

On Friday, Obama, who had called congressional leaders to the White House three times in the previous two days to hash out an agreement, played a less public role in the debate. Aides said he spoke on the phone to Boehner twice and Reid at least once, as well as huddling with his own advisers.

He canceled a Friday morning speech in Indianapolis on energy and later in the afternoon opted against a family trip to Williamsburg, Va., as a shutdown loomed.

If the government had closed, it would have meant closures at national parks and federal agencies and furloughs for more than 800,000 government workers. Just preparing for that had slowed federal business to a crawl in the past week.

Now, officials said, museums should reopen in the morning and government workers should come to work as scheduled. Washington should continue as if nothing happened.

This budget fight involved just a tiny fraction of the $1 trillion-plus that Congress doles out every year. But the timing was more important than the numbers. This was the first battle since Republicans took the House, promising to pare back government spending and deficits. So Republicans — led by Boehner, in his first intense engagement as a leader — were determined to stand their ground in their first fight.

Democrats, on the other hand, still hold the Senate and the White House. In the Senate, Democratic leaders were determined not to be outmaneuvered by Republicans. And in the White House, Obama seemed interested in cementing his role as a calm mediator, a chief executive.

And none of them wanted to be the first to blink. That might have set a damaging precedent for future fights with higher stakes, such as raising the national debt limit, and passing a 2012 budget.

The Associated Press contributed to this report.

Reaction

“I congratulate both Democrats and Republicans for coming together and agreeing on a budget compromise. Shutting down the government would’ve affected tens of thousands of Coloradans, and their livelihoods were at stake.”

Sen. Mark Udall, D-Colo.

“Thank God sanity prevailed. Now we can move on to a real, substantive conversation about a comprehensive plan that will reduce our debt and deficit in the long term.”

Sen. Michael Bennet, D-Colo.

“I voted against this short-term continuing resolution for the same reason I voted against the last one and the one before that — because it does not set us on a path to fixing the spending and debt problems our country is facing.”

Sen. Rand Paul, R-Ky.

“The American people’s top priority is creating jobs, and we will continue to measure every proposal by whether it creates jobs, strengthens the middle class and responsibly reduces the deficit.”

Rep. Nancy Pelosi, House minority leader

“Thankfully for the country, a shutdown was averted. Spending will be cut and critical services will be maintained.”

Rep. Ed Perlmutter, D-Colo.

“At least the debate in Congress, unlike the last two years, is now about how much to cut spending instead of how much to increase it.”

Rep. Mike Coffman, R-Colo.

“I hope my colleagues on the other side of the aisle will choose to turn their attention to the critical task of getting Americans back to work, rather than advancing an extreme social agenda.”

Spain came under repeated attack starting Thursday in what authorities called linked terrorist incidents, when a driver swerved a van into crowds in Barcelona’s historic Las Ramblas district, killing more than a dozen people and injuring scores of others. Early Friday, an attempted attack unfolded in a town down the coast

If there’s one superhero character whose rise might be most tied to the events of World War II, it is Captain America, who emerged from the minds of legends Joe Simon and Jack Kirby and sprung forth from an iconic 1941 debut cover on which Cap smacks Hitler right in the kisser.

A customer dining at Washington’s Oceanaire restaurant noticed an unusual line at the bottom of his receipt: “Due to the rising costs of doing business in this location, including costs associated with higher minimum wage rates, a 3% surcharge has been added to your total bill.”