“If they open fire on people and if there is bloodshed, people will get angrier,” said a protester, Ali, 40. “They are out of their minds if they think with bloodshed they can crush the movement.”

Mr. Obama’s statement was his strongest to date on the post-election turmoil in Iran. Saying that “each and every innocent life” lost would be mourned, he added: “Suppressing ideas never succeeds in making them go away. The Iranian people will ultimately judge the actions of their own government. If the Iranian government seeks the respect of the international community, it must respect the dignity of its own people and govern through consent, not coercion.

“Martin Luther King once said, ‘The arc of the moral universe is long, but it bends toward justice.’ I believe that. The international community believes that. And right now, we are bearing witness to the Iranian people’s belief in that truth, and we will continue to bear witness.”

There had been varying reports in the hours leading up to the opposition rally about whether it would be called off in the face of the government’s threatened crackdown. State television reported that Mr. Moussavi had called it off, but some of his supporters, posting on social networking sites, urged demonstrators to gather.

Image Thousands of demonstrators gathered in Tehran on Saturday. Credit... The New York Times

Journalists were banned from leaving their offices to report on the protests. A reporter from an American news organization said she had been called by a member of the Basij militia warning her not to go to the venue for the Saturday rally because the situation would be dangerous and there could be fatalities.

The authorities were also reported on Saturday to have renewed an offer of a partial recount of the ballots in the disputed election  an offer that the opposition has previously rejected. A letter from Mr. Moussavi published on one of his Web sites late Saturday repeated his demand for the election to be annulled.