Azeri foreign ministry says four embassy employees were carrying out activities ‘incompatible with diplomatic status’.
The move on Thursday came hours after Baku said it arrested six men, who it claimed were linked to Iranian secret services and were plotting a coup in the Caspian nation.
Relations between the neighbours have long been strained, with Azerbaijan being a close ally of Iran’s historical rival Turkey. Baku has also deepened relations in recent years with Iran’s regional rival Israel.
The foreign ministry in Baku said on Thursday that it had “summoned” Iran’s ambassador and told him that “four employees of the Iranian embassy were declared persona non grata” with 48 hours to leave the country.
It said they were carrying out activities “incompatible with diplomatic status” but did not provide further details.
Earlier in the day, Baku said it arrested six Azerbaijani nationals, who it said were “recruited by Iranian secret services to destabilise the situation in the country”.
It announced the arrests in a joint statement by the interior ministry, state security service and prosecutor-general’s office. There was no immediate comment from Tehran.
Azerbaijan closed its embassy in Tehran in January after its head of security was killed in an attack. It opened an embassy in Israel last week.
Iran has attacked Azerbaijan for moving closer to Israel, with its foreign ministry saying it sees the fledging relationship between Azerbaijan and Israel as “anti-Iranian”.
Azerbaijan has criticised Iran for allegedly backing Armenia in the decades-long conflict over the breakaway region of Nagorno-Karabakh.
Iran, which is home to millions of Turkic-speaking ethnic Azerbaijanis, has long accused Azerbaijan of fomenting separatist sentiment inside its territory.
The neighbours share a border that runs near the Caspian Sea.
The tensions have come as Iran is normalising ties with Saudi Arabia, which began with a surprise China-brokered deal last month to restore diplomatic relations that were severed seven years ago.