The office of supreme leader Ayatollah Ali Khamenei issued pictures of Sadr flanked by Khamenei on one side, and the commander of the elite Quds Force of Iran's Islamic Revolutionary Guard Corps, Major General Qasem Soleimani, on the other.
Iran's judiciary chief Ebrahim Raisi also attended the ceremony, which commemorates the death of Prophet Muhammad's grandson Hussein at the Battle of Karbala, in modern-day Iraq.
Sadr's surprise visit comes at a time of deep political divisions among Iraq's Shia factions, and as Baghdad tries to walk a tightrope between its two main allies, Tehran and Washington.
Tehran has close but complicated ties with Baghdad, with significant influence among its Shia political groups.
The two countries fought a bloody war from 1980 to 1988 and Iran's influence in Baghdad grew after the US-led invasion of Iraq toppled veteran dictator Saddam Hussein in 2003.
In 2014, Iran sent Soleimani and "miliary advisers" to Iraq to help it in the fight against the Islamic State group, and the general continues to play a key role as a powerbroker in Iraq during times of turbulence.
Sadr himself is a populist cleric, political figure and former militia leader whose bloc emerged as the biggest in the Iraqi parliament after May 2018 elections.
But he refused to align with the pro-Iran camp to form a government, visited Tehran's regional rival Saudi Arabia and has criticised pro-Iran paramilitary groups in Iraq - sparking contradictory analysis of the current visit.
Some observers suspected Sadr had been "summoned" to Tehran after statements challenging Iran and its Iraqi allies in the Hashd al-Shaabi paramilitary, or Popular Mobilsation Forces [PMF].
The Iraqi cleric recently launched a Twitter campaign against the more hardline elements of the Hashd and even took aim at the Baghdad government, saying Iraq was becoming a "rogue" state.
Others said it might indicate a vote of confidence in him by Iran's top leadership over the Hashd's political arm, the Fatah alliance.
Many noted it was strange to see Sadr outside Iraq on Ashura, a holy day during which millions of pilgrims travel to Karbala.
On Tuesday, a stampede broke out among pilgrims visiting the Imam Hussein shrine in Karbala that left 31 people dead and more than 100 wounded.
Follow us on Twitter: