Iranian Foreign Ministry spokeswoman Marzieh Afkham told Fars News Agency the diplomat had resisted attackers as they attempted to kidnap him and was injured as a result.

"We are seriously following up the dimensions of this terrorist action with the relevant Yemeni government officials," Afkham said.

The gunmen fled, and there was no immediate claim of responsibility. The ambassador was not in the car at the time of the attack, said the security sources.

Iran is the leading Shi'ite Muslim power in the Middle East, and its diplomatic missions in the Arab world have occasionally been targeted as sectarian violence spreads in the region.

Sectarian rivalry between Shi'ite Muslim Houthis and ultra-conservative Sunni Salafis has increased in northern Yemen in the last several months, with at least 210 people killed.

The violence erupted on October 30 when Houthi rebels, who control much of the northern Saada province, accused Salafis in the town of Damaj of recruiting thousands of foreign fighters to prepare to attack them.

Fighting between the two sides in Saada and adjacent provinces stopped as a ceasefire deal took hold a week ago.

That deal gave the Salafis four days to relocate about 250 km (150 miles) southwest to the Red Sea port of Hudaida.

Yemen said it started moving a group of Salafis out of their northern stronghold on Tuesday.

The sectarian rivalry has cast a shadow over reconciliation efforts in Yemen, a U.S.-ally that is home to one of the most active wings of the Sunni militant force al Qaeda.

The country, in turmoil since a popular uprising ousted president Ali Abdullah Saleh in 2011, is also facing southern secessionists and an economic crisis.