President Obama and congressional leaders said Friday night they have agreed to a six-day extension of government funding, averting a shutdown at the last minute and giving Congress enough time to adopt a longer-term budget.

"Today Americans of different beliefs came together again," Obama said at the White House, adding that the agreement makes necessary budget cuts while preserving needed investments. Obama noted he was standing in front of a window with a view of the Washington Monument, which, like other federal facilities, will remain open in the days ahead.

Obama's negotiating partners -- House Speaker John Boehner, R-Ohio, and Senate Majority Leader Harry Reid, D-Nev. -- made announcements on Capitol Hill, just an hour or so before the midnight expiration of the continuing resolution that was funding the government.

The Senate passed the funding extension late Friday, with the House following suit early Saturday morning.

In a speech on the Senate floor, Reid said the proposed agreement calls for cuts of $78.5 billion, including items in the budget Obama proposed two months ago that have never been approved by Congress.

Reid also said the temporary extension funds the government through Thursday, by which time lawmakers expect to have approved a budget for the rest of the fiscal year, which ends Sept. 30.

The announcements capped a day in which Republicans and Democrats accused each other of bringing the government to the brink of a shutdown, and even disagreed over the major cause of the impasse that had tied up Washington for days.

Earlier, Reid said Republicans "will be responsible for shutting down the government" if they insist on pushing plans to cut federal support for Planned Parenthood over abortion services.

Reid said no federal money goes to abortion services -- that would be illegal -- and that the GOP cuts to Planned Parenthood would serve only to deprive women of cancer screenings and other health services.

The top Senate Democrat accused Boehner of kow-towing to his conservative Tea Party faction, and said, "They're willing, it appears, to throw women under the bus even if it means shutting down the government." He urged GOP leaders to "snap out of it."

The Planned Parenthood amendment is not part of the agreement announced tonight, officials said.

"At the end of the day, this was a debate about spending cuts, not social issues like women's health and the protection of our air and water," Obama said.

Boehner, meanwhile, had argued during the day that Democrats were not backing deep enough cuts to a bloated budget.

"We've got to cut spending if we're serious about creating an environment for job creators in America," Boehner said.