WASHINGTON (AP) — For the first time in nearly two decades, the U.S. government staggered into a partial shutdown Monday at midnight after congressional Republicans stubbornly demanded changes in the nation's health care law as the price for essential federal funding and President Barack Obama and Democrats adamantly refused.

As Congress gridlocked, Obama said a "shutdown will have a very real economic impact on real people, right away," with hundreds of thousands of federal workers furloughed and veterans' centers, national parks, most of the space agency and other government operations shuttered.

He laid the blame at the feet of House Republicans, whom he accused of seeking to tie government funding to ideological demands, "all to save face after making some impossible promises to the extreme right wing of their party."

House Speaker John Boehner responded a short while later on the House floor. "The American people don't want a shutdown and neither do I," he said. Yet, he added, the new health care law "is having a devastating impact. ... Something has to be done."

The stock market dropped on fears that political gridlock between the White House and a Republican Party influenced by hardcore conservative tea party lawmakers would prevail, though analysts suggested significant damage to the national economy was unlikely unless a shutdown lasted more than a few days.

A few minutes before midnight, White House Budget Director Sylvia Burwell issued a directive to federal agencies to "execute plans for an orderly shutdown." While an estimated 800,000 federal workers faced furloughs, some critical parts of the government — from the military to air traffic controllers — would remain open.

Still, a shutdown would and inconvenience millions of people who rely on federal services or are drawn to the nation's parks and other attractions.

The State Department would continue processing foreign applications for visas, and embassies and consulates overseas would continue to provide services to American citizens.

Any interruption in federal funding would send divided government into territory unexplored in nearly two decades. Then, Republicans suffered grievous political damage and President Bill Clinton benefited from twin shutdowns in 1995 and 1996. Now, some Republicans said they feared a similar outcome.

If nothing else, some Republicans also conceded it was impossible to use funding legislation to squeeze concessions from the White House on health care. "We can't win," said Sen. John McCain, the 2008 Republican presidential candidate.

On a long day and night in the Capitol, the Senate torpedoed one Republican attempt to tie government financing to changes in the health care law, referred to as "Obamacare." House Republicans countered with a second despite unmistakable signs their unity was fraying — and Senate Democrats promptly rejected it, as well.

Defiant still, House Republicans decided to re-pass their earlier measure and simultaneously request negotiations with the Senate on a compromise. Some aides conceded the move was largely designed to make sure that the formal paperwork was on the Senate's doorstep as the day ended.

Whatever its intent, Senate Majority Leader Harry Reid rejected it. "That closes government. They want to close government," he said of House Republicans.

As lawmakers squabbled, Obama spoke bluntly about House Republicans. "You don't get to extract a ransom for doing your job, for doing what you're supposed to be doing anyway, or just because there's a law there that you don't like," he said. Speaking of the health care law that undergoes a major expansion on Tuesday, he said emphatically, "That funding is already in place. You can't shut it down."

There were some signs of fraying within Republican ranks. For the first time since the showdown began more than a week ago, there was public dissent from the Republican strategy that has been carried out at the insistence of tea party-supported Republican House members working in tandem with Republican Sen. Ted Cruz of Texas.

Republican Rep. Charles Dent said he was willing to vote for stand-alone legislation that would keep the government running and contained no health care-related provisions. "I would be supportive of it, and I believe the votes are there in the House to pass it at that point," the fifth-term congressman said.

Other Republicans sought to blame Democrats for any shutdown, but Dent conceded that Republicans would bear the blame, whether or not they deserved it.

Hours before the midnight deadline, the Senate voted 54-46 to reject a proposal by House Republicans for a temporary funding bill that would have kept the government open but would have delayed implementation of the health care law for a year and permanently repeal a tax on medical devices that helps finance it.

House Republicans countered by scaling back their demands and seeking different concessions in exchange for allowing the government to remain open. They called for a one-year delay in a requirement in the health care law for individuals to purchase coverage.

The same measure also would require members of Congress and their aides as well as the president, vice president and the administration's political appointees to bear the full cost of their own health care coverage by barring the government from making the customary employer contribution.

The vote was 228-201, with a dozen Republicans opposed and nine Democrats in favor.

Unimpressed, Senate Democrats rejected the House measure on a 54-46 party line vote about an hour later.

Obama followed up his public remarks with phone calls to Boehner and the three other top leaders of Congress, telling Republicans he would continue to oppose attempts to delay or cut federal financing of the health care law.

The impact of a shutdown would be felt unevenly.

Many low-to-moderate-income borrowers and first-time homebuyers seeking government-backed mortgages could face delays, and Obama said veterans' centers would be closed.

About 800,000 federal workers, many already reeling from the effect of automatic budget cuts, would be ordered to report to work Tuesday for about four hours — but only to carry out shutdown-related chores such as changing office voicemail messages and completing time cards.

Some critical services such as patrolling the borders and inspecting meat would continue. Social Security benefits would be sent, and the Medicare and Medicaid health care programs for the elderly and poor would continue to pay doctors and hospitals.

U.S. troops were shielded from any damage to their wallets when Obama signed legislation assuring the military would be paid in the in the event of a shutdown.

The prospect of a shutdown led U.S. stocks to sink as Wall Street worried the budget fight could lead to something much worse for the economy — a failure to raise the nation's borrowing limit.

Whether or not Congress averts a shutdown, Republicans are sure to move the health care fight to a must-do measure to increase the borrowing cap, which is expected to hit its $16.7 trillion ceiling in mid-October.

Obama has vowed not to negotiate over the debt ceiling, noting that a default would be worse for the economy than a partial government shutdown.

The U.S. risks a market-rattling, first-ever default on its obligations if Congress fails to raise that limit.

Both a shutdown and a default would be politically risky ahead of next year's congressional elections.

Some Republican leaders fear the public will blame their party for the shutdown. But individual House members may face a greater risk by embracing a compromise. Many represent heavily partisan congressional districts, and voters in primaries have ousted lawmakers, particularly Republicans, they see as too moderate.

Since the last government shutdown, temporary funding bills have been noncontroversial, with neither party willing to chance a shutdown to achieve legislative goals it couldn't otherwise win.

But with the 3-year-old health care law nearing implementation, tea party conservatives are determined to block it.

There are few issues Republicans feel as passionately about as the health care reform. They see the plan, intended to provide coverage for the millions of Americans now uninsured, as wasteful and restricting freedom by requiring most Americans to have insurance.

A crucial part of the plan begins Tuesday, whether or not the government partially closes: enrollment in new health care exchanges for millions of uninsured Americans. That's because most of the program is paid from monies not subject to congressional appropriations.

___

Associated Press writers David Espo, Alan Fram, Andrew Taylor, Laurie Kellman, Pauline Jelinek; Henry Jackson, Donna Cassata and Stacy A. Anderson in Washington and Marc Levy in Harrisburg, Pennsylvania, contributed to this report.