Khatami declared on Feb. 8 he would run again for president, setting the stage for a major political showdown in coming months between the popular reformist - who made dialogue with the West a centerpiece of his eight years as president - and the country's ruling hard-liners.
His candidacy poses a serious threat amid popular discontent with Ahmadinejad over the sagging economy, and the action against the Web sites came as Khatami named leaders in charge of his election campaign.
The Web sites, www.yaarinews.com and www.yaari.ir, were set up last summer in anticipation of Khatami's candidacy. They could not be accessed from inside Iran on Saturday, though they were viewable outside the country.
Khatami's own campaign site, www.khatami.ir, was still accessible.
"At midday, we learned that our Web sites have been blocked. ... Closing down our Web sites means hard-liners are not going to tolerate Khatami challenging Ahmadinejad," Behrouz Shojaei, editor of one of the sites, told The Associated Press Saturday.
Yaari News, which Shojaei runs with other Khatami supporters, has reported on his candidacy, the reformist's views and growing support for his presidential bid. The other targeted Web site presented people's views on Khatami's candidacy.
Shojaei said the government was also likely angered after the sites reported that provincial officials bused people in to attend a rally where Ahmadinejad was speaking in the city of Yazd on Wednesday.
Ahmadinejad allies claimed that the relatively large crowd showed the hard-line president's popularity. It might also have been an attempt to strike a blow to Khatami, whose birthplace is Yazd.
Prominent Khatami ally Majid Ansari said blocking the sites was simply an attempt to increase pressure on reformists before the election.
"Reformist opponents assume they can block the path of people's understanding but people are wise enough to judge these actions," Ansari said.
"Blocking sites won't stop Khatami from challenging (Ahmadinejad)," he said.
Khatami's candidacy poses a serious challenge to Ahmadinejad, whose mixture of anti-Western rhetoric and fiery nationalism sharply contrasts with Khatami's tempered tones and appeals for global dialogue.
Khatami's decision to run against Ahmadinejad could significantly shake up Iran's politics, appealing to citizens disillusioned by the country's failing economy and Ahmadinejad's staunch anti-U.S. foreign policy.
Relations between the United States and Iran improved marginally during Khatami's eight years in office, and he encouraged athletic and cultural exchanges. But it deteriorated after the Sept. 11 attacks when former President George W. Bush declared Iran belonged to an "axis of evil." Ahmadinejad widened that gap after he was elected in 2005.
But Khatami's decision to run comes as President Barack Obama has signaled a willingness for a dialogue with Iran, particularly over the Islamic Republic's controversial nuclear program.
Hard-liners have vowed they would never again allow reformists to take control of the government and have used the Guardian Council, an election watchdog that vets candidates, and other institutions they control to block reformists from gaining power. It is unclear if the Council will move to block Khatami's candidacy.
Reformists have suffered setbacks in past years as hard-liners and conservatives have consolidated power. Hundreds of reformist newspapers have been shut down, and the Guardian Council barred thousands of reformist candidates from running in parliamentary elections in 2004 and 2008.