WASHINGTON — U.S. government agencies were ordered to close for the first time in more than 17 years after lawmakers stalemated over Republican efforts to block President Obama's healthcare law.

More than 800,000 federal workers were to spend Tuesday, the first day of the new fiscal year, on unpaid furloughs as agency managers executed contingency plans for the costly process of closing down operations indefinitely.

The official word to shut down came from the White House just before midnight Monday. Hours earlier, the Senate, by a 54-46 party-line vote, killed a House measure that would have funded government agencies for six weeks but delayed key parts of Obamacare for a year.

It was the second such vote that the Senate took during a day in which the two chambers exchanged volleys of legislation with little expectation that any of it would become law.

The one exception to the legislative futility was a bill to ensure that military service members would be paid during the shutdown. Obama signed it into law late Monday night.

The House's final legislative effort passed 228 to 201, mostly along party lines. It would have delayed for one year the requirement in the healthcare law that individuals have insurance or pay a fine and would have reduced benefits for members of Congress and some of their staff members.

Early Tuesday, the Republican-controlled House voted to set up a House-Senate committee that could seek a compromise in coming days. Democratic leaders in the Senate asserted that they would not negotiate under duress, however, and insisted that the House first pass a measure temporarily providing funds for government agencies.

"You know, with a bully you cannot let them slap you around," Senate Majority Leader Harry Reid (D-Nev.) said after the Senate's initial vote. "They slap you around today, they slap you five or six times. Tomorrow it will be seven or eight times. We are not going to be bullied."

Obama warned that a shutdown would harm the nation's economy and vowed that the healthcare law, his signature domestic policy achievement, would move forward.

Indeed, among the ironies of the standoff is that a shutdown will have no effect on the law the Republicans tried to block. The money to implement the law does not depend on the annual spending bills stuck in the congressional logjam. A major element of Obamacare, online marketplaces that consumers without insurance can use to buy coverage, will open to the public Tuesday.

"That funding is already in place. You can't shut it down," Obama said during a short appearance earlier in the White House briefing room.

"This is a law that passed both houses of Congress, a law that bears my signature, a law that the Supreme Court upheld as constitutional, a law that voters chose not to repeal last November," he said, referring to his reelection.

"I'm always willing to work with anyone of either party to make sure the Affordable Care Act works better," he added. "But one faction of one party in one house of Congress in one branch of government doesn't get to shut down the entire government just to refight the results of an election."

Republicans, for their part, insisted that blame for the stalemate fell on Democrats. The president and his party, they said, had put preserving Obamacare ahead of keeping government agencies running.

"Americans didn't want Obamacare forced on them, and they don't want a shutdown forced on them either," Republican National Committee Chairman Reince Priebus said in a statement. "Once again, Democrats are unwilling to listen."

Obama spoke with the four leaders of the House and Senate on Monday evening, including a 10-minute conversation with House Speaker John A. Boehner (R-Ohio), but neither side indicated progress toward a deal.

Late in the evening, after the Senate's second set of votes, Sen. Lisa Murkowski (R-Alaska), one of the few remaining GOP moderates, urged colleagues to compromise. "There are real lives, real families, laying awake wondering what the rest of the week is going to mean to them," she said. "It's not just about the next election."

But on both sides, many more lawmakers were looking beyond Monday's midnight deadline and focusing on which party would bear the brunt of public anger if a standoff disrupts government services.

The stalemate happened because Congress failed to pass any of the annual laws, known as appropriations, that provide money for government agencies. Federal law says agencies cannot spend money without an appropriation except when necessary to protect life or property, or in cases of programs that have permanent sources of funds.

Widespread disruption of services probably will not occur for a while. Many basic government functions do not depend on annual spending bills. Social Security checks will go out as always, for example, as will payments under Medicare. Mail delivery will be unaffected. Courts, which have reserve funds that can last for some time, will still hear cases.

But as other government functions close, economists say, a prolonged shutdown will slow growth. A two-week standoff would shave about three-tenths of a percentage point off the current growth rate, projections indicate. Although not huge, that punch would sting in an economy expanding at less than 2% per year. A longer standoff would cut growth more.

The last time the government closed, during the Clinton administration, two shutdowns took place. One lasted five days; the other, affecting only part of the government, ran three weeks.

Who gets the political blame for a shutdown will have a big impact on how the standoff ends.

Nearly all Democratic strategists and many Republican ones think Democrats hold the upper hand in the current fight, indicating that Republicans would eventually have to yield. Polls so far have indicated that Americans are somewhat more likely to blame congressional Republicans than Obama for the stalemate, although the advantage Democrats have is much smaller than the one they enjoyed in the Clinton-era standoff.

A Washington Post-ABC News poll released Monday showed majorities of the public disapproving of the way all the major actors in the budget drama have handled their roles, but giving congressional Republicans the worst reviews. Obama got the approval of 41% and the disapproval of 50%. Congressional Republicans got just 26% approval and 63% disapproval; congressional Democrats, 34% approval and 56% disapproval.

Some conservative Republicans argue that Obamacare's unpopularity ultimately will give them an advantage. Although polls show the health law is unpopular, the same surveys show the public does not support shutting down the government to block it.

In a CNN/ORC poll also released Monday, for example, Americans said, 60% to 34%, that it was "more important" for Congress to pass "a budget agreement that would avoid a government shutdown" than to approve legislation "preventing major provisions in the new healthcare law from taking effect."

As several polls have shown, Democrats remain largely united behind Obama, but significant numbers of Republicans disapprove of their party's leaders. That has proved true in Congress as well. Relatively conservative Democrats, such as Sen. Joe Manchin III of West Virginia and Mark Pryor of Arkansas, have consistently voted with Reid during the current standoff. By contrast, divisions on the Republican side have been open and bitter and continued to plague the party Monday.

In closed-door meetings, some of the most conservative members objected to the leadership's plans on the grounds that the latest House proposal would delay only part of Obamacare — the requirement that individuals buy health insurance — rather than the entire law.

On the other side, a group of Republicans, mostly from Northeastern and Midwestern states, said they believed the GOP should drop its efforts to block Obamacare and simply approve a measure to keep government agencies open. The group failed to round up enough support to block the Republican leadership's plans on Monday, but it could become a factor if the standoff drags on.

The party's current strategy is "a dead end," said Rep. Peter T. King (R-N.Y.). "We're going to shut the government down, and, when all is said and done, we're going to get blamed for it.

With Congress moving closer and closer to the deadline to approve the funding necessary to prevent the government from shutting down, here's a look at the planned drawbacks and furloughs across the government, including the Pentagon and the Smithsonian. Read more: Government shutdown: What you...

NAVAL STATION NORFOLK — The Navy on Saturday commissioned the USS John Warner, adding a 12th Virginia-class submarine to the fleet and celebrating the legacy of its namesake, the retired senator who was hailed as a statesman.