Hamid al-Khafaf, chief spokesperson for al-Sistani, said that the senior Shia Ayat Allah had persuaded al-Sadr to accept what was described as a very positive initiative.
In a press conference held at 2030 GMT, interim Iraqi minister of state, Qasim Dawud, confirmed that his government has accepted the agreement between al-Sadr and al-Sistani.
"I congratulate the Iraqi people on this victory - there is no more fighting in Najaf or Kufa," he said.
He also conveyed the interim Iraqi government's pledge to fund reconstruction of destroyed areas throughout Najaf.
Dawud also said that Iraqi marchers to the holy shrines in Najaf would be given due access on the condition they leave the shrines by 0600 GMT on Friday.
Political force no more?
AFP is reporting that the agreement is comprised of a five-point plan, including tenets that Iraqi police would resume responsibility for security in Najaf and Kufa, and the interim government would compensate those who have suffered in the weeks of heavy fighting.
Husain al-Haidari, an Iraqi journalist in Najaf, told Aljazeera that al-Sadr had agreed in principle to remove the al-Mahdi Army's military presence in Najaf and Kufa.
Al-Sadr, whose whereabouts were unknown since 22 August, is reported to have visited al-Sistani's home where the talks where held.
According to excerpts of the agreement, al-Mahdi Army militia members who lat down their arms and withdraw from the holy shrines by 0600 GMT will be granted amnesty.
Al-Sadr himself will be allowed to go free, but there has been no clarification whether the Shia leader will be allowed participation in Iraq's political future, particularly in upcoming elections.
The future of the al-Mahdi Army, which al-Sadr had declared ready to be transformed into a political party, is also unclear.
"We have passed three-fourths of the way and we are at an agreement that retains the honour of all those involved," he added.
"There is full agreement among all the parties, and the doors will never be closed in the face of a settlement," al-Khafaf said.
He also said al-Sistani urged US and Iraqi national guardsmen to allow Iraqis marching to the holy shrines access to the embattled city.