DUBAI, United Arab Emirates>> Iran said Saturday it executed a former high-ranking defense ministry official and dual Iranian-British national, despite international warnings not to carry out the death sentence. The execution further escalated tensions with the West amid the nationwide anti-government protests shaking the Islamic Republic.

The hanging of Ali Reza Akbari, a close ally of top security official Ali Shamkhani, suggests an ongoing power struggle within Iran’s theocracy as it tries to contain the demonstrations over the September death of Mahsa Amini. It also harkened back to the mass purges of the military that immediately followed Iran’s 1979 Islamic Revolution.

Akbari’s hanging drew immediate anger from London, which along with the U.S. and others has sanctioned Iran over the protests and its supplying Russia with the bomb-carrying drones now targeting Ukraine.

“This was a callous and cowardly act, carried out by a barbaric regime with no respect for the human rights of their own people,” British Prime Minister Rishi Sunak said.

Foreign Secretary James Cleverly summoned Iran’s chargé d’affaires in the United Kingdom and separately warned: “This will not stand unchallenged.”

The United Kingdom sanctioned Iran’s prosecutor-general, Mohammad Jafar Montazeri, on Saturday night “with immediate effect” over Akbari’s execution.

Iran similarly summoned the British ambassador after the execution.

Iran’s Mizan news agency, associated with the country’s judiciary, announced Akbari’s hanging without saying when it happened. However, there were rumors he had been executed days earlier.

Iran has alleged, without providing evidence, that Akbari served as a source for Britain’s Secret Intelligence Service, known popularly as MI6. A lengthy statement issued by Iran’s judiciary claimed Akbari received large sums of money, his British citizenship and other help in London for providing information to the intelligence service.

However, Iran long has accused those who travel abroad or have Western ties of spying, often using them as bargaining chips in negotiations.

Akbari, who ran a private think tank, is believed to have been arrested in 2019, but details of his case emerged only in recent weeks. Those accused of espionage and other crimes related to national security usually are tried behind closed doors, where rights groups say they do not choose their own lawyers and are not allowed to see evidence against them.

Iranian state television aired a highly edited video of Akbari discussing the allegations, footage that resembled other claimed confessions that activists have described as coerced confessions.

The BBC Farsi-language service aired an audio message from Akbari on Wednesday, in which he described being tortured.

“By using physiological and psychological methods, they broke my will, drove me to madness and forced me to do whatever they wanted,” Akbari said in the audio. “By the force of gun and death threats they made me confess to false and corrupt claims.”