With a midnight deadline looming, the White House and Congress struggled on Friday to break a budget impasse that threatens to shut down the U.S. government and idle hundreds of thousands of federal workers.

Democratic and Republican congressional leaders blamed each other for the stalemate over government funding for the rest of the fiscal year, which ends Sept. 30, and could not even agree on what issues were the final stumbling blocks to a deal.

Democrats said the two sides were at odds over federal funding for birth control. Republicans said spending cuts were the issue.

Without an agreement, money to operate the federal government for the next six months would run out at midnight on Friday (0400 GMT on Saturday) and agencies such as the Internal Revenue Service would begin a partial shutdown.

Congressional staff continued negotiations on Friday afternoon, and President Barack Obama canceled a planned family weekend trip to Williamsburg, Virginia, to remain in Washington and monitor the talks.

The bitter political fight raised questions about the ability of Obama and a divided U.S. Congress to deal with bigger issues looming down the road, from raising the federal debt ceiling to reining in budget deficits.

"They've got to be laughing at us right now" in China, said Senate Foreign Relations Committee Chairman John Kerry. "How terrific that the United States of America can't make a decision."

The White House said a shutdown would idle about 800,000 federal government workers and could slow the U.S. economic recovery. Vital services such as defense, law enforcement, emergency medical care and air traffic control would continue.

Without a deal, many official websites would darken and furloughed government workers would be required to power down their BlackBerries. Trash would go uncollected in Washington, and national parks and monuments like the Statue of Liberty in New York would close.

Investment firm Goldman Sachs (GS.N) estimates a government shutdown lasting more than a week could cost the economy $8 billion in missed federal spending, dragging down growth.

AT ODDS

Republican and Democratic aides said negotiators have agreed to $38 billion in cuts but remain at odds over where they would fall. Republicans are resisting a Democratic proposal to cut $1.7 billion from defense.

Obama called House of Representatives Speaker John Boehner, the top Republican in Congress, and Senate Majority Leader Harry Reid, the top Democrat, about the continuing talks.

Reid said the final issue was a Republican push to give states greater discretion over federal funds earmarked for birth control and women's health clinics. Democrats say that would give Republican governors license to block those funds.

"Republicans want to shut down the government because they think there's nothing more important than keeping women from getting cancer screenings. This is indefensible and everyone should be outraged," Reid said on the Senate floor.

But Boehner said the final stumbling block was spending cuts that Republicans say are needed to rein in budget deficits hitting $1.4 trillion a year.

"We're not going to roll over and sell out the American people like has been done time and time again in Washington. When we say we're serious about cutting spending, we're damn serious about it."

Senate Republican Leader Mitch McConnell said he expected lawmakers to reach agreement on a spending plan and avert a government shutdown.

Fear that a government shutdown could hurt economic growth on the margins pressured the dollar and U.S. Treasury prices on Friday. Longer-term, investors are looking at the last shutdown, in 1995, when predictions of spending cuts made both government debt and the dollar more appealing and both rose.

Citigroup (C.N), the third-largest U.S. bank, noted the budget debate is raising concern among foreign investors about how the U.S. government will deal with the budget deficit, federal debt and the budget talks for the 2012 fiscal year, which begins Oct. 1.

The showdown is the biggest test of leadership for Obama, a Democrat, and congressional leaders since Republicans made big gains and took control of the House of Representatives in elections last November.

The confrontation carries big political risks for both parties, who could be seen by voters as failing to make compromises. But Boehner is under pressure to stand firm in the talks from Tea Party conservatives who helped fuel last year's big Republican election gains.

Reid said Senate Democrats planned to vote on a one-week funding extension that would fund the Pentagon for the year but include no spending cuts to give more time for negotiations. Obama threatened to veto a bill passed by the Republican-led House for a one-week extension that included another $12 billion in spending cuts.

Republicans said they would not allow a vote on a stopgap measure to keep the government operating beyond midnight on Friday unless it contains additional spending cuts.

Any deal reached at this point would require several days to implement, meaning Congress will have to pass some sort of short-term bill to keep the government functioning. (