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.

FULL COVERAGE: Obamacare and the shutdown

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."

PHOTOS: Who's furloughed? What's shut down?

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.