Iran summoned the envoy of neighbouring Azerbaijan on Tuesday and recalled its own ambassador from Baku for consultations to protest what it describes as the Azeri government's "insults to the sanctities" of Islam.
Over the past weeks, Iranian clerics have denounced Azerbaijan for hosting the upcoming Eurovision song festival and for allegedly permitting gay rallies, which are banned in Iran.
Baku, however, has never staged a gay pride parade.
The official IRNA news agency said a protest note was delivered to Azerbaijan's Ambassador Javanshir Akhundov.
The two neighbours have strained relations.
Oil-rich Azerbaijan has nurtured close relations with the US and played an active role in Western-led programs. That foreign policy has put it at odds with Iran, which hosts a sizable ethnic Azeri community.
In recent months, Iran expressed concern over alleged Israeli intelligence activity in the Caucasian state.
In return, Azerbaijan said it arrested dozens hired by Iran to carry out terrorist attacks against the US and Israeli embassies as well as Western-linked groups and companies.
Both sides have denied the charges.
Iran summoned the Azeri envoy after Israel in February signed a $1.6 billion deal to sell drones, anti-aircraft and missile defense systems to Azerbaijan. The deal would bring Israeli technology to Iran's borders.
Israel has hinted at an attack on Iran's nuclear facilities, charging Iran is trying to make nuclear weapons.
Iran denies this and says its nuclear program is for peaceful purposes.