President Donald Trump in the Rose Garden of the White House in Washington, D.C. Andrew Harrer | Bloomberg | Getty Images

President Donald Trump on Saturday took a swing at Democrats who blocked a last-minute measure to fund government operations, calling their near-uniform opposition an attempt to give him a "nice present" to commemorate his first anniversary as president. Late Friday evening, the Senate failed to pass a short-term spending bill that would have kept the government open for at least a few weeks, triggering a round of partisan finger-pointing. Early in the day, Trump blamed Democratic lawmakers for the current impasse in Washington — even as the short-term spending bill was opposed by a few in his own party. "Democrats are far more concerned with illegal immigrants than they are with our great military or safety at our dangerous southern border," Trump posted on Twitter. "They could have easily made a deal but decided to play shutdown politics instead."

He added: "This is the one-year anniversary of my presidency and the Democrats wanted to give me a nice present. #DemocratShutdown." In years past, government shutdowns have served as a proxy for fights over federal spending — and usually when the White House and Congress are run by different parties. Yet the current impasse has hinged largely on divisive hot-button issues such as immigration, something Trump referenced on Saturday in his broadside against Democrats. Democrats are holding our Military hostage over their desire to have unchecked illegal immigration. Can't let that happen! The Senate is expected to resume talks on funding the government later in the day. On the first anniversary of his presidency, with the stock market roaring and the economy adding jobs, Trump had planned to rest at his Mar-a-Lago estate in Florida, feted by friends and admirers. Tweet Instead, Trump stayed in Washington in an attempt to prevent the federal government from having to shut its doors, meaning that non-essential services would cease until a spending bill gets approved.

Senate Minority Leader Chuck Schumer Jonathan Ernst | Reuters

Despite having ascended to the presidency on a carefully-crafted image as a dealmaker, Trump was unable to convince recalcitrant Democrats, and even a few restive GOP members, to drop their opposition. Democrats pressed hard for measures to resolve sticky wedge issues like immigration and children's health, which have also managed to divide Republicans. The White House and its allies have placed much of the blame on Democrats, particularly Trump's fellow New Yorker, Senate Minority Leader Chuck Schumer. For his part, the Democrat placed the blame back on the president's shoulders. "It's almost like you were rooting for a shutdown," Senate Democratic leader Chuck Schumer said of Trump on Saturday. Trump was forced to postponed a long-planned weekend trip to his winter home Mar-a-Lago, where a lavish $100,000-a-couple fundraiser on Saturday would extol his first year in office. Yet he had little choice. Critics would have hammered him for attending such an event while government workers were being put on leave and many government services curtailed. Tweet Back in September, Trump cut a short-term government funding deal with Schumer and House Democratic leader Nancy Pelosi. The harmony between the president and the top Democratic Congressional leaders didn't last long, however, as divisions over immigration set the parties against one another. Schumer and Pelosi thought they had reached an agreement to preserve a program that protected Dreamers, but Trump reportedly walked away. The standoff culminated in a heated negotiation session last week, where Trump was said to have used a vulgar term to describe immigrants from Haiti and Africa. - Reuters contributed to this story

WATCH: Trump's doctor says he aced his mental fitness test. Here's how hard it really was.