Get breaking news alerts and special reports. The news and stories that matter, delivered weekday mornings.

Americans blame President Donald Trump and congressional Democrats about equally for the three-day government shutdown that ended Monday with another stopgap spending measure, according to a new NBC News|SurveyMonkey poll.

About 4 in 10 people, or 39 percent, think Democrats in Congress are responsible for the shutdown, which began early Saturday morning after Senate Democrats, citing insufficient progress on negotiations over the fate of young immigrants covered by the DACA program, withheld their support for a deal.

A similar share, 38 percent, blamed Trump for the shutdown. Just under 2 in 10 (18 percent) said Republicans in Congress were to blame. Taken together, however, the poll shows that a slight majority of Americans — 56 percent — blame the president and his party.

Let our news meet your inbox. The news and stories that matters, delivered weekday mornings. This site is protected by recaptcha

Partisan identity plays a big role in assigning blame, the survey shows. Eighty-five percent of Republicans and Republican-leaners blame Democrats for the shutdown. And while a third of Democrats and Democratic-leaners — 33 percent — blame Republicans for the shutdown, 62 percent of Democrats blame Trump.

When it comes to independents, 48 percent point the finger at Trump. But a sizable 31 percent blame congressional Democrats for the stalemate, and only 16 percent think Republicans are to blame.

Tense talks over the weekend resulted in Senate Democrats deciding Monday to support a three-week funding bill that would re-open the government in exchange for GOP assurances that Congress would take up a larger immigration bill in the coming weeks.

But a majority of Americans don't think Trump, who was largely absent from the formal negotiations, showed strong leadership qualities during the shutdown crisis, which coincided with the anniversary of his inauguration.

Two thirds of Americans — 66 percent — support Deferred Action for Childhood Arrivals, or DACA, the Obama-era program at the center of the impasse. There are some divisions by party, though. A slight majority of Republicans said they oppose DACA, which protected young immigrants brought to the U.S. illegally as children from deportation. An overwhelming majority of Democrats said they support it.

Still, 81 percent of Americans said it was unacceptable for the president or members of Congress to threaten a government shutdown to achieve their goals.

The NBC News|SurveyMonkey poll was conducted from Jan. 20 to 22, 2018, among a national sample of 3,450 adults. Respondents for this nonprobability survey were selected from the nearly three million people who take surveys on the SurveyMonkey platform each day. Results have an error estimate of plus or minus 2.2 percentage points. For full results and methodology, click here.