Egypt has freed an Iranian diplomat who had been detained over spying allegations after the state security prosecutor received confirmation of his diplomatic status.
Egypt's official MENA news agency reported that the Iranian's status was confirmed by Egypt's Foreign Ministry.
But MENA also reported that the diplomat had operated in a way that breached diplomatic protocol.
Earlier, Al-Arabiyah television named the man as Kassem al-Hosseini, and described him as a diplomat.
It said he had been detained for "passing information."
The detention comes amid moves by Iran and Egypt seen as aimed at improving ties following the February ouster of Egyptian President Hosni Mubarak.
Relations between the two countries were cut after Iran's 1979 Islamic Revolution and after Egypt made peace with Israel.
Although they still do not have full diplomatic relations, Iran and Egypt each has a mission in the other's capital.