The handover of the keys to representatives of Grand Ayatollah Ali al-Sistani appeared to provide a face-saving way out of the crisis for militia leader Moqtada Sadr after his supporters earlier scoffed at government claims he had surrendered control of the Hazrat Ali (RA) shrine to Iraqi police.
"The keys were handed to the office (in Najaf)," Sistani spokesman Sayed Murtadha al-Kashmiri told AFP in London where the top cleric has been receiving medical treatment.
Earlier on Friday, a spokesman for Sadr said Sistani had agreed to take the keys to pave the way for a peaceful resolution to the bloody stand-off around one of Islam's holiest shrines.
"We went to Sistani's office this morning to agree on giving up the keys to the mausoleum. His office called Grand Ayatollah Ali al-Sistani in London, who agreed to take the keys," Sheikh Ahmed al-Shaibani told AFP in Baghdad.
"The visitors, human shields and militiamen will then leave the shrine," he added.
Sadr has repeatedly balked at demands from Iraq's US-backed caretaker government that he hand control of the mosque compound to a police force he regards as a US tool.
Sistani, on the other hand, still commands enormous respect among Shias across the political spectrum despite a reputation for moderation that has won plaudits from the US-led coalition.
The symbolic handover came after a day of confusion in which Iraqi government officials had insisted against all evidence on the ground that police had entered the mosque compound and detained several hundred militiamen.
An AFP correspondent in the shrine said he had not seen a single policeman.
On the contrary, he said fighting continued sporadically on the south side of the Old City between the militiamen and US-backed forces that have surrounded the shrine compound.
In Washington, a US defence official also strongly rejected the claims of Iraqi spokesmen.
"Not a lick of truth to it," he said. "We are still outside of the shrine, and so are the Iraqi police."
It was unclear why government officials in Baghdad had so wildly overstated the situation on the ground.
"Iraqi police entered the shrine in Najaf city and all armed militia were evicted," a government spokesman had announced in Baghdad.
Interior ministry spokesman Sabah Kadhim too said police were in control of the compound.
"The Iraqi police entered the mosque to discover 500 men with light arms who were prepared to surrender," he told CNN.
"We, in co-operation with the appropriate religious authorities, were able to restore control without any fight and help the people inside."
The spokesman suggested Sadr might have slipped away during the night, but the claim was vigorously rejected by a spokesman for the cleric who insisted he "will not leave Najaf except (through) martyrdom."
In the capital's main Shia neighbourhood of Sadr City, the US military said a three-day offensive was continuing in conjunction with Iraqi security personnel.
The health ministry said 10 people had been killed and 79 wounded in the 24 hours to Friday morning.
The US military said two marines had been killed and two wounded since the operation began on Wednesday.