WASHINGTON — The federal government officially ran out of funding at midnight on Saturday, passing a deadline to avert a shutdown after the Senate failed to pass a short-term spending bill.

A late Friday evening Senate vote on a House funding bill failed to garner 60 votes needed. But the vote was held open for more than two hours, as senators of both parties were huddled in unusual feverish talks to try to strike a deal. Sen. Lindsey Graham (R-S.C.) and Sen. Jeff Flake (R-Arizona) went back and forth from groups of Democrats and Republicans, as reporters in the press gallery watched in amazement at the scene unfolding.

But Senate Majority Leader Mitch McConnell finally called for the vote to be read. It was 50 to 49.

“What we have just witnessed on the floor was a cynical decision by Senate Democrats to shove aside millions of Americans for the sake of irresponsible political games,” McConnell said after the vote. He vowed to return it to the floor later on Saturday.

Senate Minority Leader Chuck Schumer responded, “Every American knows the Republican Party controls the White House, the Senate, the House. It’s their job to keep the government open. It’s their job to work with us on a way to move things forward.”

If the shutdown lasts beyond the weekend, hundreds of thousands of government employees may be furloughed and agencies closed.

Earlier in the day, Sen. Lindsey Graham (R-S.C.) floated the idea of a three-week spending bill to Feb. 8, which is just the type of temporary solution that he has opposed. But he said that “we are inside the 10-yard line” on issues like providing protection for Dreamers, military spending and children’s health insurance funding.

But Democrats, coming out of their own caucus meeting, appeared to reject that as a solution. Graham ultimately sided with the Democrats in voting against the House funding bill, along with Rand Paul (Ky.), Mike Lee (R-Utah) and Sen. Jeff Flake (R-Arizona). Sen. Claire McCaskill (D-Mo.), Sen. Heidi Heitkamp (D-N.D.), Sen. Joe Manchin (D-W. Va.), Sen. Doug Jones (D-Alabama) and Sen. Joe Donnelly (D-Indiana) voted in favor of it.

White House Press Secretary Sarah Huckabee Sanders called the Democrats “obstructionist losers.”

With just over two hours to the deadline, President Donald Trump sent out a tweet that a shutdown was the way things were heading.

“Not looking good for our great Military or Safety & Security on the very dangerous Southern Border,” he wrote. “Dems want a Shutdown in order to help diminish the great success of the Tax Cuts, and what they are doing for our booming economy.”

The shutdown at midnight would coincide with the first anniversary of Trump’s inauguration, and he canceled a plans to  travel to Mar-a-Lago in Palm Beach, Fla., where he was to attend a celebration on Saturday evening. It was the first government shutdown while one party controlled the White House and two chambers of Congress.

Democrats have been adamant about rejecting a funding deal that does not address the Dreamers, the undocumented immigrants who came to the United States when they were children. They blame not just congressional Republican leadership, but Trump for rejecting a bipartisan immigration deal after initially indicating that he would be receptive to it.

Republicans included in their spending bill a six-year extension of the Children’s Health Insurance Program, but Democrats called that inclusion of that provision a cynical effort to garner their votes without addressing the issue of DACA.

The shutdown’s impact on the entertainment industry not be as great as it was in the last one, in 2013, when the federal government closed for 16 days. Back then, the closure of national parks forced producers to reschedule location shoots. In that shutdown, the FCC all but closed except for essential services. This time around, the agency said it has contingency funding until the end of the day on Jan. 26. On Friday, a federal judge in the Justice Department’s lawsuit against AT&T and Time Warner said that he was unlikely to reject any motion that would delay the case.

What was odd on Friday was how, hours before the vote, the Capitol was strangely serene, hardly the hub of activity seen on other days and certainly not when a shutdown is looming. Schumer went to the White House to meet with Trump earlier in the day. He said that he even put the issue of a border wall on the table, and it looked as if they were headed for some kind of a deal, but the president backed away from it.

Even that was not enough to entice the president to finish the deal,” Schumer said.

“Here we are on the eve of what might have to be the shutdown of the United States government,” said Sen. Kamala Harris (D-Calif.). “And let’s be clear about something else. This is about a group that is more interested in protecting their power than about protecting their people.”