Ahmadinejad also said Iran would soon triple its daily production of low-enriched uranium (3.5 per cent), in defiance of the West and its threats of new sanctions over Tehran's disputed nuclear programme.
Al Jazeera's Nazanine Moshiri, reporting from Azadi Square, said: "From where I am standing, I can see a sea of Iranians holding flags, waving placards, anti-Western placards, and pictures of Ayatollah Khomeini, the former supreme leader who is viewed as the father of the revolution.
"Speaking to opposition protesters in the last few days ... they have told me that they will be trying to attend the rally, they will be coming in a peaceful way."
Reports on Thursday suggested that police clashed with protesters in several sites around Tehran.
Gangs also attacked senior opposition figures as they tried to attend the rallies.
Two leaders of the so-called Green Movement - Mohammad Khatami, a former president, and Mehdi Karroubi - came under attack and their supporters clashed with police.
Houssein - a son of Karroubi, one of the defeated reformist candidates in last year's disputed presidential poll - said his father's car had been attacked by security forces on his way to the rally.
The Revolutionary Guards and police had said they would crack down heavily on any protests which, since they first erupted last June, have threatened the Islamic government and split the senior clergy.
Rahesabz, an opposition website, and witnesses said clashes took place at Sadeghieh Square, about a kilometre from where masses were gathered at Azadi Square to mark the toppling of the shah, Mohammad-Reza, 31 years ago.
The website said the cars of Khatami and Karroubi came under attack by police and plainclothes security men but neither was hurt.
Alireza Ronaghi, Al Jazeera's correspondent in Tehran, said: "The government ... is not going to tolerate any kind of demonstrations with symbols of the opposition.
"We have heard from elsewhere in the city that opposition demonstrators who were trying to join the rally had been stopped on their way by security forces."
Zahra Rahnavard, wife of Mir Hossein Mousavi, the main opposition leader, was also "beaten" while Mousavi himself was prevented by security forces from joining the rally, according to Kaleme.org, another opposition website.
The reports could not be independently confirmed as the foreign media have been barred from covering opposition street marches.
Rahesabz also said Mohammad Reza, a brother of Khatami, and his wife Zahra Eshraghi, who is a granddaughter of Ayatollah Ruhollah Khomeini, the founder of the Islamic revolution, were briefly detained by security forces.
Karroubi's son Houssein told the AFP news agency his father was "not injured but his guards who were accompanying him were".
Security forces "fired tear gas and were brandishing knives when they clashed with our supporters" before the cleric reached Sadeghieh Square in western Tehran from where he was supposed to join the marches.
Karroubi's other son, Ali, was also arrested, Houssein said.
The clashes, which started in western districts, had spread to Tehran's northern suburbs by early afternoon, the opposition websites said.
They said security forces fired tear gas in several clashes.
Some of the worst violence was in and around Vanak Square, a wealthy district of northern Tehran, with clashes also reported in the western district of Amirabad, the websites said.
Celebrations to mark the anniversary have traditionally been festive, and an opportunity for Iranian leaders to display popular support for the establishment.
But this year's event has been disrupted by anti-government protests despite the massive security operation.
Apart from plainclothes security forces, reinforcements of the Basij militia were at the site, near a key university dormitory where anti-shah demonstrations flared during the 1979 revolution.
The website and witnesses said motorcycle-mounted anti-riot police were seen moving into key city centres, including around Iran's radio and television stations and offices of the country's supreme leader, Ayatollah Ali Khamenei.
Inspectors from the International Atomic Energy Agency (IAEA) were informed by Tehran that "Iran had begun to feed the low-enriched uranium into one cascade" of centrifuges at its Natanz plant, Yukiya Amano, the IAEA chief, said in the report.
Ahmadinejad's disputed re-election last June plunged the Islamic republic into one of its worst ever political crises, with the opposition refusing to take the fight off the streets despite often deadly crackdowns.