Handcuffed, his face bruised and his newspaper offices reeking of tear gas, one of Iran's most influential media figures was spared detention only by the urgent intervention of President Mahmoud Ahmadinejad.
Monday's bungled attempt to arrest Ali Akbar Javanfekr, the president's top press adviser, was the most dramatic illustration yet of the intensifying power struggle among Iran's ruling hardliners.
About 30 of Mr Javanfekr's staff at the Iran daily scuffled with armed officers from the judiciary who stormed the building. One journalist was injured by a blow from an electronic baton.
Another, Abdol Reza Soltani, declared: "The basic lesson we have learnt from Ahmadinejad is to defend the ideals of the revolution with our lives."
During a period of pressure from abroad, the Iranian regime usually attempts to paper over its rifts. But even as western powers continued to ratchet up sanctions over Tehran's nuclear programme and while Israel rattles its sabres, those rifts have become more exposed in the run-up to vital parliamentary elections in March.
Mr Ahmadinejad has powerful enemies in the judiciary, parliament and the Revolutionary Guards. They have accused him of trying to bolster the power of his office at the expense of parliament and of trying to undermine the clergy's role.
They have relentlessly attacked Mr Ahmadinejad since he fell out in April with Iran's supreme leader, Ayatollah Ali Khamenei, in a public dispute over a cabinet posting. Parliamentarians have made repeated threats to impeach the president while the judiciary has arrested several figures in his outer circle.
But the combative and populist Mr Ahmadinejad has made clear he has no intention of serving out the remainder of his second term until 2013 as a lame-duck president. He has hit back at attempts to contain him by threatening to reveal his opponents' corruption.
This summer, Mr Ahmadinejad set a "red line" against any attempt to prosecute those in his inner circle. That vow will be tested in the coming days and weeks by what happens to Mr Javanfekr, a valued ally.
The soft-spoken, bearded and bespectacled Mr Javanfekr runs Iran's official news agency, IRNA, and is manager of its print affiliate, Iran. Both are mouthpieces for Mr Ahmadinejad's government and publicise its policies and messages to the outside world.
On Sunday, Mr Javanfekr was sentenced to a year in jail and banned from journalism for three years because of an article in Iran in August was deemed to have offended public decency. He has 20 days to appeal and planned to do so, his lawyer said.
The article focused on the dress code for women, an emotive and political issue in Iran. It included an interview with a former senior adviser to the president who argued that the chador, a black, all-encompassing garment for devout women, was brought to Iran after to a trip to France by a 19th century Shah. The monarch was said to have been inspired by the evening dress of fashionable Parisian women.
Although the article was supportive of the headscarf, Iran's judiciary deemed it contrary "to Islamic values" for suggesting the chador was not rooted in Islamic tradition. Mr Ahmadinejad's hardline rivals have often accused him of being lax on the dress code, claiming he is attempting to win over middle-class voters.
They also claimed that the populist president was in thrall to a "deviant" current in his administration that was supposedly determined to undermine Iran's clergy and the supreme leader.
A defiant Mr Javanfekr hit back at the president's opponents on Saturday in an interview with a reformist daily, Etemad. "If they meant the deviant current is a deviation from their ideals, we confirm it," he said.
Attempting to turn the tables on the president's opponents, Mr Javanfekr argued that those opposing Mr Ahmadinejad were effectively challenging the supreme leader. Ayatollah Khamenei controversially endorsed as a "divine blessing" Mr Ahmadinejad's fiercely disputed re-election in June 2009; a decision he must now regret.
Mr Javanfekr also criticised the arrests in recent months of figures loyal to Mr Ahmadinejad. He singled out the treatment of one political prisoner whom Mr Javanfekr said has been held in solitary confinement since June and was now suffering from psychological problems. He expressed sympathy for some reformist political figures who have been jailed without due legal process.
Iran's judiciary, infuriated by Mr Javanfekr's remarks, on Sunday ordered Etemad to be shut for two months for "disseminating lies and insults to officials in the establishment".
The Javanfekr affair shows that the "president's avid supporters have begun to challenge the judiciary for its conduct", said Farideh Farhi, an Iran expert at the University of Hawaii.
Mr Javanfekr was largely silent when only reformists were being arrested and mistreated in prison. Now, Ms Farhi said in an interview, "he has become vocal either because his friends and himself are being mistreated or he hopes that criticising the judiciary will attract votes for Ahmadinejad and his allies in the upcoming parliamentary elections".
Extolling the president, Mr Javanfekr even suggested that the Occupy Wall Street movement and the Arab uprisings were inspired by Mr Ahmadinejad's "anti-capitalism and anti-USA imperialism" policies.