"Anybody who fights against the Islamic system or the leader of Islamic society, fight him until complete destruction," he said in the nationally broadcast speech.
The cleric alleged that some involved in the unrest had used firearms.
"Anyone who takes up arms to fight with the people, they are worthy of execution," he said. "We ask that the judiciary confront the leaders of the protests, leaders of the violations, and those who are supported by the United States and Israel strongly, and without mercy to provide a lesson for all."
Khatami said those who disturbed the peace and destroyed public property were "at war with God," and said they should be "dealt with without mercy."
He reminded worshippers that Iran's supreme leader, Ayatollah Ali Khamenei, rules by God's design and must not be defied.
The cleric also lashed out at foreign journalists, accusing them of false reporting, and singled out Britain for new criticism.
"In this unrest, Britons have behaved very mischievously and it is fair to add the slogan of 'down with England' to slogan of 'down with USA,'" he said, as his remarks were interrupted by worshippers' chants of "Death to Israel."
Meanwhile, USA TODAY's Ken Dilanian is reporting today that President Barack Obama is planning to fund groups that support Iranian dissidents. This would be a continuation of a program that became controversial when it was expanded by President George Bush, and would could contradict earlier administration statements that the United States is not providing support for the dissidents.
The U.S. Agency for International Development has for the last year been soliciting applications for $20 million in grants to "promote democracy, human rights, and the rule of law in Iran," according to documents on the agency's website. The final deadline for grant applications is June 30.
U.S. efforts to support Iranian opposition groups have been criticized in recent years as veiled attempts to promote "regime change," said Trita Parsi, president of the National Iranian American Council, the largest Iranian-American advocacy group. The grants enable Iran's rulers to paint opponents as tools of the United States, he said.
Although the Obama administration has not sought to continue the Iran-specific grants in its 2010 budget, it wants a $15 million boost for the Near Eastern Regional Democracy Initiative, which has similar aims but does not specify the nations involved. Some of that money will be targeted at Iran, said David Carle, a spokesman for the appropriations subcommittee that oversees foreign affairs.
"Part of it is to expand access to information and communications through the Internet for Iranians," Carle said in an e-mail.
President Obama said this week the United States "is not at all interfering in Iran's affairs," rejecting charges of meddling that were renewed Thursday by Iranian President Mahmoud Ahmadinejad.
Asked how the democracy promotion initiatives square with the president's statement, White House spokesman Tommy Vietor said, "Let's be clear: The United States does not fund any movement, faction or political party in Iran. We support . . . universal principles of human rights, freedom of speech, and rule of law."
State Department spokesman Ian Kelly said, "Respecting Iran's sovereignty does not mean our silence on issues of fundamental rights and freedoms, such as the right to peacefully protest." [The State Department oversees the USAID.]
The Bush program "was a horrible idea," Parsi said. "It made human-rights activists and non-governmental organizations targets."