Al-Sadr's message was addressed to the crowd as well as Iraqi lawmakers and read by his aide Sheik Abdul-Hadi al-Mohammadawi before a huge crowd of mostly young men waving Iraqi and green Shiite flags and chanting slogans including "no, no to the agreement" and "yes to Iraq."
"The Iraqi government has abandoned its duty before God and its people and referred the agreement to you knowing that ratifying it will stigmatize Iraq and its government for years to come," he said.
"I am with every Sunni, Shiite or Christian who is opposed to the agreement ... and I reject, condemn and renounce the presence of occupying forces and basis on our beloved land," the message added.
Al-Sadr, who is living in Iran, also cast doubt on the Iraqi government's argument that the security pact is a step toward ending the U.S. presence in Iraq. The deal would require U.S. forces to leave by Dec. 31, 2011 unless Iraq asked some of them to stay.
"If they tell you that the agreement ends the presence of the occupation, let me tell you that the occupier will retain its bases. And whoever tells you that it gives us sovereignty is a liar," al-Sadr said. "I am confident that you brothers in parliament will champion the will of the people over that of the occupier ... Do not betray the people."
The demonstrators marched from the main Shiite district of Sadr City to the more central Mustansiriyah Square in eastern Baghdad.
"No, No to America," shouted one man, wearing a white Islamic robe as he sat in a wheelchair and clutched a poster of the Iraqi flag. "We prefer death to giving concessions."
Security was tight with Iraqi security forces manning checkpoints on sidestreets and snipers on rooftops. Iraqi Humvees controlled all the roads leading to the square. Giant Iraqi flags covered nearby buildings.
One banner in English said: "We refuse the existence of the U.S. in Iraq."
Organizers insisted the turnout for the demonstrations exceeded 1 million, but Associated Press reporters and photographers at the scene said the crowd was in the tens of thousands. Police had no estimates of their own.
"This demonstration is our response to the agreement," said Nasser al-Saadi, one of 30 Sadrist lawmakers. "It is also meant to demand a popular referendum on the agreement."
The three-hour gathering ended without trouble except for a brief incident when several young demonstrators pelted army troops manning a checkpoint with rocks. There were no injuries and no arrests.
Prime Minister Nouri al-Maliki's government and the Bush administration have hammered out a draft agreement after months of bitter negotiations. But the Iraqi parliament must ratify the deal and Iraq's pre-eminent cleric Grand Ayatollah Ali al-Sistani has said any accord must have national consensus.