The government shutdown is over. Democrats finally realized that closing the government over illegal immigration was a losing political battle. They created a needless crisis and got rolled. So who is to blame for their current predicament? Along with Charles E. Schumer and Nancy Pelosi, Democrats can put the blame squarely on the man who could have legalized the “dreamers” when he had the chance: Barack Obama.

During his 2008 campaign, Obama promised in a conversation with Univision anchor Jorge Ramos to make passing immigration reform one of his first legislative priorities, and even set a timetable. “I cannot guarantee that it is going to be in the first 100 days,” he said. “But what I can guarantee is that we will have in the first year an immigration bill that I strongly support and that I’m promoting. And I want to move that forward as quickly as possible.”

If he had wanted to act, he could have. Obama’s party controlled the House, and Democrats had a 60-vote filibuster-proof Senate majority. If Obama really wanted to pass either the Dream Act or comprehensive immigration reform, Republicans were powerless to stop him. But he didn’t do it.

In a 2012 interview, Ramos called Obama on it. “At the beginning of your governing, you had control of both chambers of Congress, and yet you did not introduce immigration reform. And before I continue, I want for you to acknowledge that you did not keep your promise.” Obama objected that he had made his promise “before the economy was on the verge of collapse. . . . And so my first priority was making sure that we prevented us from going into a Great Depression.” Ramos was having none of it. “It was a promise, Mr. President. . . . And a promise is a promise. And with all due respect, you didn’t keep that promise.”

Obama’s excuse was weak. In the midst of dealing with the economic crisis, he championed ObamaCare and got other legislation passed. If passing immigration reform had been a real priority, he could have done it. And if he had, there would be no immigration impasse today.

Of course, Obama was not alone in failing to act. Who was in charge of the issue on Capitol Hill? On the Senate side, none other than Schumer (D-N.Y.). In 2009, Schumer succeeded Edward M. Kennedy (D-Mass.) as chairman of the Senate Judiciary subcommittee on immigration. In that role, the New York Times reported, “Mr. Schumer would take the point in pushing for passage of a new bill.” But Schumer didn’t push. Neither did Pelosi (D-Calif.), who was speaker of the House at the time and had the power to bring immigration legislation to the floor at will. And Obama also did not push because, according to the Times, the president “does not intend to get out in front of any proposal until there is a strong bipartisan commitment to pass it.” Funny, he did not wait for a “strong bipartisan commitment” before pushing ObamaCare. But apparently immigration was not a priority.

By the time Obama got around to immigration legislation, Republicans had retaken the House. After failing to act when he had the votes, in 2012 Obama announced he would implement Deferred Action for Childhood Arrivals, an unlawful executive action to effectively legalize the presence of illegal immigrants who had arrived in the United States as children. The Post’s editorial board correctly called it an “unprecedented” move that “flies in the face of congressional intent,” adding that “Republicans’ failure to address immigration . . . does not justify Mr. Obama’s massive unilateral act.” Even “Saturday Night Live” skewered Obama’s executive action.

President Trump was right to reverse Obama’s unconstitutional decision. He had no choice. He also said at the time he supported letting DACA recipients stay, set a deadline of March 5 for a legislative solution and added that he would be willing to give Congress even more time if necessary. “Congress now has 6 months to legalize DACA,” Trump tweeted on Sept. 5. “If they can’t, I will revisit the issue!”

In other words, there was no crisis for DACA recipients. This was, as Obama said when Republicans shut down the government in 2013, a “manufactured crisis” — one that Obama helped manufacture with his broken immigration promises. For once, Democrats were the ones making unreasonable demands. And now Democrats will have to pay the political price. If they don’t like it, they can only blame themselves and Obama.

This column first appeared in the Washington Post.