"As his car was pulling away, it was attacked and hit by gunfire. But, as it is an armoured car, only the windows were damaged."

Chanting crowds

The attackers chanted slogans in support of the government and Ayatollah Ali Khamenei, the supreme leader, the website said.

"Our town is not a place for hypocrites," they were report as saying.

in depth

  Riz Khan: How will Iran deal with protesters?
  Inside Story: Opposition gaining momentum
  Timeline: Iran after the election

The Rajanews.com website, which is close to the government, confirmed that Karroubi's motorcade had come under attack by a stone-throwing crowd, but it made no mention of gunfire or basij militia being involved.

"Several thousand angry people surrounded the house where Mehdi Karroubi was," it said.

"Anti-riot police tried several times to clear a way through the crowd to extricate Karroubi's vehicle which finally left under a hail of stones, eggs and tomatoes."

Foad Izadi, a professor of political communication at Tehran University, told Al Jazeera: "The political situation in Iran is not very calm.

"When you have one of the leading opposition members visiting a town that is somewhat more religious, it is understandable some people are not going to like it."

Along with Mir Hossein Mousavi, another reformist leader, Karroubi complained that the re-election of Mahmoud Ahmadinejad, the president, was marred by vote rigging and fraud.

The accusation sparked a series of protests in the capital Tehran and elsewhere, which later spilled over into violent clashes between opposition supporters and security forces.

Hundreds of opposition leaders, activists and protesters have been arrested since a crackdown on the protests shortly after the election.