There's no question that President Donald Trump views immigration as a winning political issue for him.

His plan to build a border wall to keep Latin American immigrants out of the U.S. was the signature promise of his 2016 campaign. He peppers his political rallies with red-meat lines, like the assurance that his administration will be "sending them the hell back." And on Friday, when he tried to end the already-fading House GOP leadership hopes of passing an immigration overhaul bill next week, he did it in starkly political terms.

"Republicans should stop wasting their time on Immigration until after we elect more Senators and Congressmen/women in November," Trump tweeted Friday of the midterm elections that will determine control of Congress for his final two years in office. "Dems are just playing games, have no intention of doing anything to solves this decades old problem. We can pass great legislation after the Red Wave!"

A little while later — and just a couple of days after talking about his compassion for families separated at the border under his "zero tolerance" policy — the president accused Democrats of telling "phony stories of sadness and grief, hoping it will help them in the elections."

But it's Trump himself who has repeatedly sabotaged congressional efforts to work with his administration to pass a major rewrite of the nation's immigration laws. It's Trump who incessantly talks about the politics of immigration. And it's Trump who did a 360-degree turn on the separation issue — first implementing it as a deterrent to future immigrants; then, when confronted with images of detained children, issuing an executive order to try to keep families together; and finally, on Friday, framing horror stories of broken families as a sham Democratic plot to win power in Congress.

There's only one logical conclusion to draw: He'd rather have the political issue than the policy victory.

Call it the art of no deal.

"Trump knows hard-line immigration reform remains at or near the top of every issue poll of Republican voters," former Republican Rep. David Jolly of Florida said. "What he lacks in understanding of actual immigration policy, he makes up for with a keen understanding of the dark border security themes that pervade the GOP. He knows anger motivates more than contentment. It's clear he has a deliberate strategy to carry this issue unresolved into November."

On Friday, Trump held an event at the White House with "angel families" who have lost loved ones to violence perpetrated by illegal immigrants.

Rather than slinking away from an issue that has burned him in recent days, Trump is keeping attention on it. His attempt to regain control of the narrative follows a familiar pattern: a move to direct the conversation to serious crimes committed by some migrant adults, rather than the detention of children who have been separated from their parents.

And his policy pirouettes demonstrate just how much he's willing to spin to try to stay on the right side of the politics.

Last week, he said he'd veto a House GOP compromise immigration bill backed by Republican leadership. Amid the outcry that followed, he tweeted that he could only sign a bill that would fully fund his border wall, crack down on illegal immigration, rewrite the rules for legal immigration, protect so-called Dreamers from deportation and reverse his separation policy.

But the bill he had just said he would not sign into law already included all of those items — just about everything he's said he wants in immigration legislation.

Confronted with the fact that the bill was tailored to his demands, Trump backed down from his position. Then he traveled to Capitol Hill this week to urge GOP lawmakers to pass it. And then, when it was on life-support Friday, he pulled the plug by publicly saying members of his party were "wasting their time" by even considering it.

"He can't take yes for an answer," Sen. Tammy Baldwin, D-Wis., said Friday on MSNBC's "Morning Joe."

For Trump, actually scoring immigration policy wins on Capitol Hill would mean leaving behind a potent political weapon. Mike Blake / Reuters file

Jolly said congressional Republicans are getting bamboozled by the president.

"What's more difficult to understand is why congressional Republicans continue to allow themselves to be his foil, projecting only failure and weakness to their own GOP constituents otherwise enamored by the president's projected strength," he said.

It's not just Republicans who have felt the jerking of Trump's fits and starts on policy and the sting of his slings and arrows on immigration politics. The president has also repeatedly backed away from deals he'd reportedly cut with Democrats to fund his border wall in exchange for allowing certain undocumented immigrants to remain in the country and possibly become citizens in the future.

And yet Trump made a pitch for just that policy in his meeting with House Republicans this week.

"There is no one in the room more hard-line on immigration than me, but this gives people an incentive, otherwise there is no incentive," he said of the path to citizenship. "This is a tremendous incentive. So you're talking 12, 13 years out and then you don't even get a green card until the wall is built so this is an incentive to get the wall built faster. People are going to want us to build the wall. So that plus border security."

Ultimately, that was too much a price to pay for immigration hard-liners, who have termed the latest House GOP effort "amnesty" because of its citizenship provisions.

"Agreed!" Rep. Steve King, R-Iowa, wrote in response to Trump's tweet urging the party to stop trying to pass a legislative fix. "Time for this Congress to put this misguided Amnesty effort in the shredder."

That's the reaction Trump wants from base Republican voters as the midterms approach. And it's why he appears to determined to both keep the immigration issue alive and refuse to cut a good-faith bargain.