The killing of Abu Bakr al-Baghdadi has given Donald Trump a lifeline in the midst of a battle for his own political survival and he has grabbed it with both hands.

Trump’s 50-minute television appearance on Sunday to announce the successful mission began with a sombre announcement before drifting into something more rambling and vainglorious, foreshadowing how he will use it for political ends, and as a club to swing at his political enemies pushing for his impeachment.

He stressed that congressional Democratic leaders had been kept out of the loop, as they could not be relied on to keep it secret. Within minutes, his supporters were framing the impeachment hearings as an unpatriotic attack on a leader keeping America safe.

Trump celebrated the death of Baghdadi, noting he had “died after running into a dead end tunnel whimpering and crying and screaming”. The Isis leader was a “dog”, a “gutless animal”, and the Isis militants who died alongside him were “losers” and “frightened puppies”.

It sounded like the dialogue of a triumphant chieftain in a made-for-TV warrior epic, and at one point Trump confirmed he had witnessed it almost as a piece of cinema, “as though you were watching a movie. The technology alone is really great.”

While the prepared statement focused on the special forces who had carried out the raid, the president’s impromptu remarks in answer to reporters’ questions, reverted to the Trumpian norm, presenting it as a personal achievement.

“I kept saying where’s Al-Baghdadi,” he said. “I have been looking for him for three years.” Days earlier, Trump had denigrated his former defence secretary, James Mattis, for being “overrated” and “not tough enough”, and boasted: “I captured Isis. Mattis said it would take two years. I captured them in one month.”

The personality cult that Trump is seeking to construct had already taken on an alarming tone. Over the weekend, his press secretary, Stephanie Grisham, had denounced another former aide turned critic, John Kelly, as “totally unequipped to handle the genius of our great president”.

Profile Who was Abu Bakr al-Baghdadi? Show Abu Bakr al-Baghdadi is thought to have been born in the central Iraqi city of Samarra in 1971. Though a weak student, whose poor eyesight disqualified him from joining the Iraqi military, he rose to command al-Qaeda’s Iraqi division and then broke away to form Islamic State (Isis). In July 2014, shortly after Isis said it had established a caliphate in Iraq and Syria, Baghdadi delivered a sermon from a mosque in the captured Iraqi city of Mosul. Appearing unmasked for the first time, he declared himself to be the caliph: the political and religious leader of the global Muslim community. His declaration was roundly rejected by almost all Islamic religious authorities but his caliphate became a magnet for thousands of foreign fighters and women. The group attempted not just to hold territory but to administer it like a state, establishing a brutal justice system, collecting taxes and doling out public services. Baghdadi had been seen publicly on one other occasion, in an 18-minute video released in April this year. From 2016 he had a $25m bounty on his head. He had been reported to have suffered serious injuries in airstrikes over the years, and there had occasionally been speculation that he had been killed, but he continued to resurface in audio tapes and videos. He killed himself in October 2019, while under attack from US forces. Michael Safi Photograph: -/AFP

It was clear within minutes of announcing Baghdadi’s death, that the delusional bubble around the president would now be even harder to puncture. In one particularly bizarre claim for someone known not to use a computer, the president said that Isis “use the internet better than almost anyone in the world, perhaps other than Donald Trump”.

Trump’s obsession with his predecessor was also very much at the fore. He left little doubt that Barack Obama’s success in tracking down and killing Osama bin Laden was on his mind. Baghdadi was the greater scalp, he argued. “Osama bin Laden was very big but Osama bin Laden became big with the World Trade Center,” Trump declared. “This is a man who built a whole … country, a caliphate, and was trying to do it again.”

Trump also repeated a claim that he had somehow had a hand in Bin Laden’s downfall by calling for him to be targeted before the 9/11 attacks, before he was generally perceived as a threat. It is a false claim. Trump mentions Bin Laden in passing in one of his books, does not call for him to be tracked down, and the al-Qaida leader was already widely seen as a substantial threat following several attacks on the US.

Donald Trump is joined in the White House situation room by, from left, the national security adviser, Robert O’Brien, Vice-President Mike Pence, secretary of defense, Mark Esper, and chairman of the joint chiefs of staff Gen Mark Milley. Photograph: Handout/Getty Images

Within minutes a photograph was put online of Trump in the situation room, that recalled the famous picture of Obama and his top aides witnessing the final moments in the hunt for Bin Laden. The Trump version was more formal, more staged, and with the president much more clearly the central, focal point.

When Bin Laden was killed in 2011, one of Obama’s first calls was to George W Bush, who had launched the hunt for the al-Qaida leader. By contrast, Trump is seeking to erase the Obama legacy. The secretary of state, Mike Pompeo, repeatedly makes the false claim that it was the current administration that amassed a coalition to defeat Isis. That coalition was almost totally put together and made operational under Obama.

In anticipating how Trump is likely to spend this treasure trove of political capital, the order in which other parties were given credit is instructive. Russia was named first and repeatedly. Moscow had no part in the operation but after being informed through deconfliction channels that an operation in the Idlib area was imminent they did not try to shoot the US gunships down.

Turkey was thanked several times too, and even the Syrian regime, for no more than being the sovereign power in the territory where the raid took place.

The commander of the Kurdish-led Syrian Democratic Forces, Mazloum Kobani, tweeted on Sunday morning that the hunt for Baghdadi had been a five-month US-SDF joint intelligence operation, but in Trump’s remarks, the Kurds were mentioned last and somewhat grudgingly.

Trump has abandoned the SDF and the Kurds in a deal with Recep Tayyip Erdoğan, that has allowed Turkey, Russia and the Syrian regime to take over control of north-east Syria, and at the expense of the Kurds. If Mazloum’s claim of the SDF role in the Baghdadi hunt is accurate, the scale of Trump’s betrayal is all the greater.

In his remarks on Sunday, Trump said Turkey “has taken tremendous deaths … they’ve lost thousands and thousands of people from that safe zone” referring to the border area that was under SDF control. The claim is untrue, but it echoes Ankara’s talking points, equating the SDF with the PKK Kurdish insurgents inside Turkey, and arguing the invasion was an urgent necessity for Turkish security.

If there was any doubt before this week, Trump made even clearer that his sole preoccupation in Syria was with the oil reserves in the east.

“The oil is so valuable,” he said. US forces, who have already begun streaming back into Syria heading for the oil fields around Deir Ezzor, would help to keep them out of the hands of Isis. Secondly, oil revenues would help the Kurds.

“And number three, it can help us because we should be able to take some also,” Trump said. “And what I intend to do perhaps is make a deal with an ExxonMobil or one of our great companies to go in there and do it properly.”

Baghdadi’s killing will help underline the simple foreign policy message that Trump is crafting for his re-election campaign. He alone inflicted a decisive defeat on Isis. Having achieved that, US troops will be withdrawn except when it is direct US economic interests to stay. Trump’s cooperation with Russian and Turkish leaders had brought about this great success. And lastly, and most importantly, the Democrats, like the intelligence committee chair, Adam Schiff, are seeking to undermine these achievements with their politically motivated pursuit of impeachment.

One of the president’s Fox News surrogates, Jeanine Pirro, gave an early taste of White House messaging. “Judge Jeanine” tweeted: “So proud of @realDonaldTrump taking out abu bakr al bagdadi. Maybe the intelligence committee under @Adam schiff should start focusing on America’s enemies and not their selfish political agenda.”

A lot can still go wrong for Trump. A desire for revenge could trigger an Isis resurgence, aided by the chaos caused by the Turkish offensive. Escaped Isis detainees could be involved in attacks. Conflicts with Iran and North Korea could sour the Trump pitch of having saved America from global conflicts.

But there is no doubt that a damaged, embattled Trump, who was losing the confidence of even staunch politically allies, is now greatly strengthened.