Both Mr Ahmadinejad (left) and Mr Mugabe (right) are under Western sanctions
President Robert Mugabe has backed Iran's "just cause" on seeking nuclear power, as President Mahmoud Ahmadinejad continues his Zimbabwe visit.
Zimbabwe's leader said both countries had been "unjustly vilified and punished by Western countries".
Iran is subject to a range of UN diplomatic and trade sanctions, although it insists its nuclear project is for energy, not to build a weapon.
Mr Ahmadinejad has opened a trade fair in Zimbabwe's second city, Bulawayo.
Iran's leader also castigated Western nations, saying: "They want to seize the markets of the countries [Iran and Zimbabwe] and destroy their economies," reports the AFP news agency.
The visit has exposed the deep divisions in Zimbabwe's power-sharing government.
The Movement for Democratic Change of Prime Minister Morgan Tsvangirai has condemned the visit and did not send anyone to welcome Mr Ahmadinejad at Harare's airport on Thursday.
It said inviting him to open a trade fair was like "inviting a mosquito to cure malaria".
The leader of oil-rich Iran is due to travel to Uganda later on Friday.
Oil has recently been discovered in Uganda, which currently holds a seat on the UN Security Council.
IRAN - General sanctions
Block on import/export of "sensitive nuclear material and equipment"
Ban on supply/sale of equipment/technology aiding nuclear programme
Assets freeze and travel restrictions on people involved in nuclear programme
ZIMBABWE - Targeted sanctions
EU: Assets freeze and travel ban on some Mugabe allies, arms-sale ban
US: Trade ban on 250 Zimbabwean individuals and 17 companies
Other countries: Canada, Australia and UK among nations to have imposed their own targeted sanctions
Sources: EU, Reuters, US treasury, UK Foreign Office
At a state dinner in honour of Iran's leader in Harare, Mr Ahmadinejad said: "The only sin... we have committed is the cancelling of the concessions that the West had in our country.
"The United Nations' organ of the Security Council is being used to serve the powerful countries to put pressure on the smaller countries like Iran and Zimbabwe."
Zimbabwe is believed to have uranium deposits in the north of the country, but as yet no exploration contracts have been awarded and the size of the deposits are unknown, according to the Reuters news agency.
Foreign Affairs Minister Simbarashe Mumbengegwi, an ally of President Mugabe, said Zimbabwe would benefit from the Iranian leader's visit by signing several trade and co-operation agreements.
Mr Mugabe and some of his closest allies are subject to targeted sanctions by several Western nations.
These include a travel ban and an assets freeze but not trade measures.
The MDC has expressed concern that the trip could affect attempts to improve relations with the West.
Mr Tsvangirai was due to visit Europe for talks this week on getting the sanctions lifted but his trip was delayed by the volcanic ash flight ban.
The MDC joined a power-sharing government in 2009 in an attempt to revive the ruined economy.
Mr Mugabe previously tried to portray the MDC as a stooge of the former colonial power, the UK.
He has criticised it recently for failing to get the sanctions on him lifted.
They were imposed after the US and the EU accused Mr Mugabe of rigging elections.
He says they were really a punishment for his policy of seizing land from white farmers.