(Updates with details, background)
By Adel and al-Khader
SANAA, Feb 9 (Reuters) - A bomb exploded inside a taxi in the Yemeni capital Sanaa on Sunday, killing a colonel in the country's domestic secret service, a security source said.
It was the latest attack targeting senior officers in the Western-allied country.
The source said two other people were seriously wounded in the blast which occurred outside the oil ministry building in downtown Sanaa. The source blamed Islamist militants linked to al Qaeda for the attack.
State news agency Saba said the explosion at the gate of the oil ministry was caused by a car bomb. It said the driver and a passerby died in the blast while a number of people were wounded.
Yemen has been grappling with violence and lawlessness since Arab Spring protests forced long-serving President Ali Abdullah Saleh's rule in 2011.
The security source said the bomb had apparently been placed under the driver's seat inside the taxi, which was driven by Colonel Mohamed Saber, a senior officer in the country's political security service.
The source said Saber was working undercover while driving the taxi. Two passengers inside the vehicle had their legs amputated by the blast and were taken to hospital in critical condition, the source added.
The blast rippled through the middle of the white Toyota Echo and scattered metal parts on the street.
"The car moved and suddenly there was an explosion," one witness told Reuters television.
Yemenis say security officers sometimes use taxis during undercover duty or to supplement their income in a country facing severe financial problems.
Dozens of senior Yemeni officers from the domestic secret service, army and police have been killed in a wave of attacks in the past two years, mostly in drive-by shooting attacks or by bombs planted in their vehicles.
Yemeni authorities blame al Qaeda for the string of attack.
The U.S.-allied country is home to Al Qaeda in the Arabian Peninsula (AQAP), viewed by Western officials as one of the most active branches of the militant network founded by Osama bin Laden.
AQAP and allied Islamist militants have claimed responsibility for dozens of attacks over the past two years, targeting government facilities, military targets and oil facilities.
Interim President Abd-Rabbu Mansour Hadi has been facing other challenges in trying to restore stability to the country of 25 million, which shares a long and porous border with top world oil exporter, Saudi Arabia.
Apart from the security question, Yemen is trying to soothe demands by southern separatists for independence and incorporate rebels from the Shi'ite Houthi movement, which has been on an offensive to enhance its control over the northern part of the country. (Reporting by Mohammed Mukhashaf in Aden, Khaled Abdullah and Adel Al-Khader in Sanaa, writing by Sami Aboudi and Mirna Sleiman; Editing by Jeremy Gaunt)