The agreement to keep the government funded for the next six months would cut approximately $38 billion from the 2010 budget baseline, officials said, and $78.5 billion from President Obama's 2011 budget proposal.
It also would keep intact funding to Planned Parenthood and resist several other proposed Republican policy changes.
"We protected the investments we need to win the future," President Obama said after the deal was struck. "At the same time, we also made sure 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. These are important issues that deserve discussion, just not during a debate about our budget."
The House and Senate passed temporary resolutions to keep the government funded beyond midnight, when it was scheduled to run out, until the full agreement could be drafted and passed by Congress. That short-term bridge included the first $2 billion in cuts, officials said.
Though the House vote came after midnight, the Office of Management and Budget said there would be no shutting down of government agencies because agreement had been reached and funding was anticipated.
"I would expect the final vote on this to occur mid-next week," said House Speaker John Boehner, R-Ohio. "This has been a long discussion and a long fight, but we fought to keep government spending down because it really will, in fact, help create a better environment for job creators in our country."
Obama hailed the deal as "the biggest annual spending cut in history," and Senate Majority Leader Harry Reid, D-Nev., told the Senate, "This is historic, what we've done."
Senate Republicans pointed out that as recently as February, Democratic leaders denounced even more modest cuts than those in the deal as "draconian," "extreme" and "unworkable." They had to go the brink of a shutdown, the Republicans said, but Boehner's hard line, in the end, forced Democrats to agree to several billion more in cuts.
However, Democratic officials tried to portray the deadline deal as one in which Boehner blinked. They argued the level of cuts were similar to those discussed during a meeting at the White House the night before. The officials said Boehner came back during Friday asking for more cuts, but Obama refused.
In addition, money will not be taken from programs the president favors, such as Head Start, but instead from the automatic "mandatory spending" appropriated for departments such as the Pentagon and the Department of Transportation.
"They gave on the EPA, NPR, and Planned Parenthood riders," a Democratic official said.
However, the deal includes an abortion funding ban for Washington, D.C., which President Obama has signed into law before. And, bipartisan sources added, the agreement calls for the Senate to hold votes on rescinding the health care law and eliminating funding for Planned Parenthood.
Republicans added that the agreement denies additional funding to the IRS, requires yearly audits of the Consumer Financial Protection Bureau and mandates additional study of the health care law that they believe will aid their fight to repeal it.
Deadline Deal Averts Government Shutdown: Obama Congratulates Boehner, Reid
The deal appeared to come together very late in the day, as Republicans conferred in private and reviewed the proposed terms. Official announcements began going out before 11 p.m.
President Obama called Reid Friday evening at 11:22 p.m. and Boehner at 11:25 p.m. to thank them for their hard work.
A government shutdown would have had wide effects, including perhaps 800,000 federal worker furloughs, curtailment of public services such as mortgage, passport and loan processing, delayed tax refunds, interruption of military paychecks and disruption to a recovering economy.
Abortion took center stage in the fight over spending cuts. The abortion measure in the House Republicans' extension bill, and one they say they won't budge on, would reinstate a policy that prevented the District of Columbia from using locally generated taxes to provide financial help to poor women for abortions.
The House voted earlier this year to defund Planned Parenthood, but 41 Democrats in the Senate said they would not support that legislation. The White House said the president would not agree to any ban on funds to Planned Parenthood.
"We've come to realize that the moving target has now focused a bull's eye on women in America," Reid said before the agreement Friday. "We agreed on a number. But we are not -- we are not -- bending on women's health."
Planned Parenthood already is prohibited from using any federal funds for abortion-related services. Officials of the organization said more than 90 percent of what Planned Parenthood clinics do has nothing to do with abortion, but rather focuses on women's health services such as pap smears and mammograms.
Abortion opponents say federal funding for other services means money freed up for the purposes of conducting abortions, which they regard as ending human life.
The last time the government shutdown fully was in 1995, under President Clinton, for five days. A 21-day partial shutdown followed soon after.
ABC News' John Parkinson, Matthew Jaffe and Huma Khan contributed to this report.