Iraqi agents captured a top aide to ISIS leader Abu Bakr al-Baghdadi, and used an app on his phone to lure four commanders from the terror group into a trap, a security advisor to the Iraqi government said Thursday.

Ismail al-Eithawi, who also uses the alias Abu Zaid al-Iraqi, was nabbed in February in Turkey by Turkish authorities and handed over to Iraqi agents, Iraqi security advisor Hisham al-Hashimi told Reuters.

Hashimi described Eithawi as a direct aide to the cutthroat Baghdadi, responsible for money transfers to the group’s bank accounts in different countries.

Iraqi agents used the Telegram messaging app on Eithawi’s mobile phone to trick other ISIS commanders to cross the border from Syria into Iraq, where they were captured, Hashimi said.

Those held include Saddam Jamal, a Syrian who served as the group’s governor of Syria’s eastern Euphrates region.

Hashimi described Eithawi and Jamal as the two most senior ISIS figures ever to be captured alive.

President Trump hailed the news on Twitter.

“Five Most Wanted leaders of ISIS just captured!” he tweeted Thursday morning.

Hashimi said the operation was carried out in cooperation with US forces, part of an American-led coalition fighting against ISIS militants on both sides of the Iraqi-Syrian border.

Following Eithawi’s capture, Iraqi and American intelligence agents were able to uncover bank accounts used by the group and also secret communication codes he used, Hashimi told the news service.

Apart from Eithawi and Jamal, the operation captured three field commanders: Syrian Mohamed al-Qadeer and two Iraqis, Omar al-Karbouli and Essam al-Zawbai, Hashimi said.

“The noose is tightening around him,” Hashimi said, referring to Baghdadi, whose real name is Ibrahim al-Samarrai.

Baghdadi, the madman who declared himself ruler of all Muslims in 2014 after capturing Iraq’s main northern city Mosul, is now believed to be hiding in the Iraqi-Syrian border region after losing all the cities and towns of his self-proclaimed caliphate.

Iraqi Prime Minister Haider al-Abadi said last month he would “take all necessary measures” against militants based in Syria.

The Iraqi air force has carried out several air strikes since last year against ISIS positions in Syrian territory.

Abadi declared final victory last December over the ultra-hardline group within Iraq.

But the militants still pose a threat along the border with Syria and have continued to carry out ambushes, killings and bombings across Iraq.

ISIS last month restated their loyalty to Baghdadi, in what is believed to be their first public pledge of allegiance to him since his self-proclaimed caliphate in Syria and Iraq collapsed last year.