Venezuela President Hugo Chavez welcomed the declaration of his Iranian counterpart Mahmoud Ahmadinejad's re-election at the weekend as a "win for all people in the world and free nations against global arrogance."
He acclaimed Ahmadinejad as a "courageous fighter for the Islamic revolution, the defence of the Third World and in the struggle against imperialism."
But the recognition of the Islamic regime's Council of Guardians that it is necessary to investigate allegations of electoral fraud and to recount disputed votes indicates that all is not well in Iran.
Washington has been hostile to the country since the 1979 overthrow of the West's regional gendarme Shah Reza Pahlavi.
The US and its allies, including Israel and Britain, have seen fit to threaten the Islamic republic with a variety of political and economic sanctions and even to hint at military attack.
Former president George W Bush would have been willing to indulge Israel's desire to launch airborne strikes at Iran's nascent nuclear facilities were it not for his advisers' recognition that war against Iran would probably have spread immediately to Iraq, Lebanon and even further afield.
However, even this appreciation of reality has not prevented Western powers that turned a blind eye to Tel Aviv's development of a sizeable nuclear arsenal from lecturing Tehran on the evils of its civil nuclear programme.
If the West's assertion that there is a fine line between civil and military nuclear capability has any validity, it can only be based on intimate knowledge of how the US, British, Russian, Chinese and French nuclear operations developed.
But there are other countries that use nuclear energy to provide electricity and Iran has the same right under international law to do likewise, even if similar safety risks and problems of waste storage will apply to it as much as any other country.
Iran has refused to back down in the face of Western hostility over the nuclear issue, which it is fully entitled to do. It has also allied itself with countries such as Venezuela to use oil and gas resources in their own interest rather than that of imperialism.
This can be read as anti-imperialism, which it is, of a kind, but anti-imperialism, in common with other concepts such as republicanism and socialism, must be, at heart, progressive or it simply becomes a cover for various forms of oppression.
Iran's presidency is electable, but real power lies with an unelected supreme leader, Ayatollah Ali Khamenei, who is the final authority in the same way as an absolute monarch or military dictator.
The Islamic republic banned left-wing and secular parties, including the communist Tudeh Party of Iran, on the spurious charge of waging war against God, hanging many of their leaders and activists.
The regime's repression of trade union struggles, locking up transport workers' leaders and others, and its judicial murder of young gay men cannot be justified or hailed as anti-imperialism.
Labour movement activists in Britain have to take a more dialectical approach than simply standing four-square with the theocratic regime or its imperialist adversaries.
This involves combining defence of Iranian national independence with support for Iran's trade unionists and their allies fighting for democratic change and against discrimination based on gender or sexuality.