President Obama signed into law on Saturday a provision that will keep the federal government running through most of next week — long enough for congressional leaders to put the finishing touches on a budget compromise that will keep the federal government funded for the remainder of the fiscal year.

Obama’s promise to sign the agreement was critical to averting a government shutdown at midnight Friday. Just before 11 p.m., House Speaker John A. Boehner (R-Ohio) announced that a last-minute deal had been struck that would keep the government in operation.

On Saturday in the District, the Washington Monument opened as scheduled and the Cherry Blossom Festival went on as scheduled, as federal employees got word that they were to resume their normal working hours Monday. Lawmakers and staffers who had been working around the clock to break through the stalemate left the Capitol deserted.

Many pondered the long-term impact of the fight, which exposed the depth of the discord in Washington and offered a hint of the difficulties lawmakers are likely to face as they address other fiscal issues in the coming months. Under the agreement, the current federal budget will be reduced by about $38 billion.

“While I’m glad the parties got together on a budget, I think I share the same question most Americans have: Why did it take so long?” Sen. Lisa Murkowski (R-Alaska) said in a statement. “These conversations could have and should have happened weeks ago, rather than putting hundreds of thousands of Americans’ paychecks at risk.”

Democrats praised their leaders for standing firm against a Republican proposal to cut off federal funding to Planned Parenthood, the nation’s largest abortion provider, which also provides other general health services to millions of low-income women.

“I congratulate both Democrats and Republicans for coming together and agreeing on a budget compromise,” Sen. Mark Udall (D-Colo.) said in a statement.

But some liberals lamented that the agreement revoked the ability of D.C. officials to use local funds to pay for abortions, and said the party went too far.

“This feels an awful lot like the tax cut deal,” Rep. Anthony Weiner (D-N.Y.) tweeted late Friday. “I gotta bad feeling.”

Abortion foes promised to continue to lobby Congress to withhold federal funding for Planned Parenthood, the nation’s largest abortion provider. The agreement also displeased some Tea Party politicians who had called for more drastic cuts, and who will likely oppose the upcoming effort to lift the debt ceiling – a battle that could also paralyze parts of the government.

“The deal that was reached tonight is a disappointment for me and for millions of Americans who expected $100 billion in cuts, who wanted to make sure their tax dollars stopped flowing to the nation’s largest abortion provider, and who wanted us to defund ObamaCare,” Rep. Michelle Bachmann (R-Minn.) said in a statement.

Friday night, however, the key negotiators -- President Obama, Senate Majority Leader Harry Reid (D-Nev.) and House Speaker John Boehner (R-Ohio) -- praised the agreement as a hard-fought compromise that acknowledges the nation’s economic realities and prevents the damaging consequences of a government shutdown.

“I’m pleased that Senator Reid and I and the White House have been able to come to an agreement that will, in fact, cut spending and keep our government open,” Boehner said at an impromptu news conference around 11 p.m.

Shortly after, President Obama read a statement from the White House, pointing out that the Washington Monument, seen lit up over his shoulder, would be open as usual on Saturday.

“Today, Americans of different beliefs came together,” Obama said. He said the cuts would be painful but necessary to maintain the country’s fiscal health. “We protected the investments we need to win the future.”

That Obama has signed another stopgap measure, one that will hold until Thursday, hints at the frenzied atmosphere Friday night as negotiators scrambled to overcome a months-long stalemate between Democrats and Republicans over the 2011 federal budget.

Short for time as midnight approached, the White House issued a memo late Friday promising within 24 hours to sign a one-week spending measure approved overnight by both chambers of Congress. A final agreement to keep the government funded through the end of the fiscal year should be approved this week.

If the government had closed, it would have meant the shuttering of national parks and federal agencies, a halt to trash pickup in the District, and furloughs for more than 800,000 governments workers. Just preparing for that had slowed federal business to a crawl in the last week.

Now, officials said, 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 of Representatives, 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, President Obama seemed interested in cementing his role as a calm mediator, a CEO.

And none of them wanted to be the first to blink. That might have set a damaging precedent for future fights with higher stakes, over the decision to raise the national debt limit, and to pass a 2012 budget.

Their brinksmanship lasted even into Friday, the last day before a shutdown that would likely have damaged both parties’ political fortunes.

As the debate went on, frustration bubbled on both sides. Reid said the drawn-out negotiations had even provoked an outburst from Vice President Biden as a White House talking session hit snags Thursday night.

“Joe Biden wasn’t flustered,” Reid said when a reporter described Biden that way. “But he was damn mad.”

A key sticking point, aides said, was not about federal spending but rather about federal funding for groups such as Planned Parenthood — which was really an argument about abortion.

In accordance with federal law, none of the money Planned Parenthood gets from the government funds abortions. But the organization receives millions of federal dollars for non-abortion services for low-income people, including breast exams and Pap smears, cholesterol and blood pressure screenings, family planning and contraceptives.

Conservatives have questioned the integrity of the group and argued that even if federal funding does not pay for abortions, it frees up other money that does.

In lieu of a provision defunding Planned Parenthood, Republicans this week proposed an alternative that would change the way funding for women’s health programs is distributed, according to senior congressional aides.

Instead of providing the money in federal grants to groups such as Planned Parenthood, the funds would be sent to states in the form of block grants. It would be up to state governments to distribute those funds to health groups.

Rep. Chris Smith (R-N.J.), who co-chairs the Pro-Life Caucus, said the original legislation stripping Planned Parenthood of all its federal funding would have been a blow to the group’s abortion efforts.

He said that one-fourth of all abortions in the United States were performed at the group’s clinics and that its services for women were minimal compared with community health centers that focus on helping the poor.

“You would think this is about women’s health care,” Smith said dismissively of the Democratic arguments. “It’s about abortion.”

Abortion rights groups, including Planned Parenthood, offered mixed reactions to the compromise Saturday.

“Planned Parenthood applauds the members of Congress who stood up for women’s health,” said the organization’s president, Cecile Richards, in a statement. “However, we are deeply disappointed that the final budget deal includes a policy rider restricting the District of Columbia’s right to make its own decisions regarding how to spend local money just as the 50 states are allowed to do.”

Paul Kane, David Fahrenthold and Philip Rucker contributed to this story.