US President Barack Obama says he has seen "the right signals" in Egypt after President Hosni Mubarak's downfall.
He cited meetings between the military council and opposition groups, and the reaffirmation of peace with Israel.
He said it was "ironic" that the Iranian authorities had celebrated the ousting of Mr Mubarak but cracked down on protests in Tehran.
And he said the US would "lend moral support" to Iranians and Arabs "seeking a better life for themselves".
But he added that the US "cannot ultimately dictate what happens inside of Iran".
Mr Obama was speaking at a White House news conference.
"We're concerned about stability throughout the region," Mr Obama said. "If you're governing these countries, you've got to get out ahead of change, you can't be behind the curve.
"We have sent a strong message to our allies in the region, saying: 'Let's look at Egypt's example, as opposed to Iran's example.'"
He added: "What has been true in Egypt should be true in Iran, which is that people should be able to express their opinions and their grievances and seek a more responsive government.
"What's been different is the Iranian government's response, which is to shoot people and beat people and arrest people.
"I find it ironic that you've got the Iranian regime pretending to celebrate what happened in Egypt, when in fact they have acted in direct contrast to what happened in Egypt by gunning down and beating people who were trying to express themselves peacefully.
"My hope and expectation is that we are going to continue to see the people of Iran have the courage to be able to express their yearning for greater freedom and a more representative government."
He said the US supported political reform in the Middle East but hoped a shift to democracy would not lead to chaos and violence.
And he said Mr Mubarak's departure from power in Egypt presented an "opportunity as well as challenge" in the Israeli-Palestinian peace process.