TEHRAN, Iran -- Iran said Thursday that a team of special operatives has freed an Iranian diplomat abducted more than 19 months ago in Yemen, a rare acknowledgement by Tehran of an intelligence operation carried out on foreign soil.

The official IRNA news agency quoted deputy Foreign Minister Hossein Amirabdollahian as saying that intelligence officers undertook a "difficult and complicated operation" to secure Nour Ahmad Nikbakht's freedom from the "hands of terrorists."

Amirabdollahian added that the operation took place "in a very special area in Yemen," without elaborating or providing further details.

Yemen's Interior Ministry denied that Iran had carried out a rescue operation, saying the diplomat was instead released in a prisoner swap "outside Yemen" in exchange for "terrorist elements" held by Iran. The ministry statement, carried by the official news agency, gave no further details. Both the ministry and the agency are controlled by Iranian-backed rebels known as the Houthis.

Iran's intelligence minister, Mahmoud Alavi, told state TV that his officers carried out the operation to free Nikbakht at "minimum cost" and without giving in to the abductors' demands -- a comment that suggests there had been negotiations over the diplomat's fate.

The diplomat, who was stationed in the Yemeni capital Sanaa at the time of his abduction, returned home on Thursday, the IRNA report said. Iranian state TV broadcast footage of Nikbakht arriving at Tehran airport and being welcomed by Iranian officials, his family and relatives.

In July 2013, armed men stopped an Iranian diplomat's car as he was driving in Sanaa, forced him into their vehicle and sped away. No one claimed responsibility, but the abduction was blamed on al-Qaida-linked militants. The diplomat's name was not disclosed at the time.

In January 2014, another Iranian diplomat in Sanaa -- the embassy's economic attache, Ali Asghar Asadi -- was killed in a drive-by shooting in a busy commercial district. Yemeni security officials said their investigation suggested the gunmen first attempted to kidnap Asadi by stopping his car. When the diplomat resisted, the assailants shot him and fled the area.

At the time, relations between Iran and Yemen had soured over what Sanaa called Iranian meddling in its domestic affairs.

Yemen's government and neighbouring Sunni powerhouse Saudi Arabia accused Tehran of supporting the Shiite Houthi rebels in the country's north in an effort to destabilize the impoverished Arabian Peninsula nation. Iran has denied the allegations.

Last year, the Houthis swept down from their northern heartland and fought their way across Yemen, seizing the capital Sanaa last September and several surrounding provinces.

The crisis has threatened to split Yemen apart and push the country into full-blown sectarian warfare. Tehran denies militarily backing the Houthis, but Arab Gulf countries are unnerved by Shiite Iran's increasing assertiveness in the region.

Meanwhile, Ali Akbar Velayati, the foreign affairs adviser to Iran's Supreme Leader Ayatolah Ali Khamenei, warned against outside intervention in Yemen, saying it would harm the country and the region, the semi-official Fars news agency reported Wednesday.

Velayati was quoted as telling a visiting Yemeni delegation that "any sort of foreign intervention in Yemen's internal affairs" would lead to wider instability.

But despite the warning, Tehran has showcased its close ties to the Houthis. Iran sent its first direct flight with medical supplies and aid workers on Sunday, a day after Houthi representatives signed an agreement in Tehran to set up 14 direct weekly flights between the two countries.

The move underscored the Houthis' tightening grip over state institutions in Sanaa, even as the internationally recognized President Abed Rabbo Mansour Hadi insists he is still in charge after fleeing to the country's south.

Associated Press writer Ahmed al-Haj contributed to this report from Sanaa, Yemen.