Philip Scott Andrews/The New York Times  The House speaker, John A. Boehner, announced the federal budget agreement reached Friday night by Congressional leaders.  WASHINGTON — Congressional leaders and President Obama headed off a shutdown of the government with less than two hours to spare Friday night under a tentative budget deal that would cut $38 billion from federal spending this year.  After days of tense negotiations and partisan quarrelling, House Republicans came to preliminary terms with the White House and Senate Democrats over financing the government for the next six months, resolving a stubborn impasse that had threatened to disrupt federal operations across the country and around the globe.  Speaker John A. Boehner, who had pressed Democrats for cuts sought by members of the conservative new House majority, presented the package of widespread spending reductions and policy provisions and won a positive response from his rank and file shortly before 11 p.m.  Both Democrats and Republicans proclaimed they had reached a deal and would begin the necessary steps to pass the bill and send it to Mr. Obama next week.  Democrats said that under the agreement, the budget measure would not include provisions sought by Republicans to limit environmental regulations and to restrict financing for Planned Parenthood and other groups that provide abortions. But Mr. Boehner said in a statement that the agreement included a restriction on abortion financing in Washington.  “This has been a lot of discussion and a long fight,” Mr. Boehner said as he left the party meeting. “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.”  Speaking from the White House after the Republican meeting ended, Mr. Obama said that both sides gave ground in reaching the bargain and that some of the cuts accepted by Democrats “will be painful.”  “Programs people rely on will be cut back,” said Mr. Obama, who said Americans had to begin to live within their means. “Needed infrastructure projects will be delayed.”  The announcements capped a day of drama as lawmakers and members of the federal work force waited anxiously to see whether money for government agencies would run out at midnight.  “We didn’t do it at this late hour for drama,” Senator Harry Reid, the Democratic majority leader, said. “We did it because it has been hard to arrive at this point.”  In the closed-door Republican session, according to people present in the room, Mr. Boehner described the plan as the best deal he could wring from Democrats and said the cuts — an estimated $38 billion in reductions — represented the “largest real dollar spending cut in American history.”  Although both sides compromised, Republicans were able to force significant spending concessions from Democrats in exchange for putting to rest some of the vexing social policy fights that had held up the agreement.  Because of the need to put the compromise into legislative form, Congressional leaders said the House and Senate would vote overnight to pass a stopgap measure financing the government through Thursday to prevent any break in the flow of federal dollars. The actual budget compromise would be considered sometime next week.  The Senate approved the stopgap measure by 11:20 p.m. and the House approved it after midnight. The Office of Management and Budget issued a memo saying normal government operations were back on track.  The developments came after Republicans and Democrats spent the day blaming each other for what could have been the first lapse in government services brought on by Congress in 15 years.  As the midnight deadline approached, efforts to finish a deal intensified, and Mr. Obama and Mr. Boehner spoke by telephone to try to find an agreement.  “Both sides are working hard to reach the kind of resolution Americans desire,” said Senator Mitch McConnell of Kentucky, the Senate Republican leader, who had consulted closely with Mr. Boehner on strategy during the fractious talks. “A resolution is actually within reach. The contours of a final agreement are coming into focus.”  Mr. McConnell’s optimism could not disguise the fact that time was steadily slipping away, and testy leaders of the two parties were pushing hard to shape public perceptions of who was responsible for an impasse that threatened to have serious political repercussions — and to presage even more consequential fiscal showdowns in the months ahead. Democrats said Republicans were insisting on overreaching policy provisions; Republicans said it remained about money.  Michael D. Shear contributed reporting.
Lawmakers reached a tentative deal shortly before a deadline that would have shuttered federal facilities and furloughed thousands of workers.