Two al Qaeda militants died in southern Yemen on Friday when a bomb they were carrying on a motorbike went off prematurely near the headquarters of the paramilitary police, an official said.

The incident occurred in the Mansoura district of the southern port city of Aden close to a building where the Central Security Service is based.

It blew up as it was getting near the building, the security official told Reuters, adding that he thought the dead men were suicide bombers.

He said one of the men had been identified, adding that the explosion did not damage the building and that nobody else was hurt in the blast.

The al Qaeda-affiliated group Ansar al-Sharia said in a statement it was behind the botched attack, saying its two fighters had been martyred after their device exploded by mistake.

The mujahideen (holy warriors), may God bless them both, were on their way to carry out a jihadi operation against a target linked to the puppet Sanaa regime, the emailed statement said.

The group also rejected as false and ridiculous a government report that said military and security forces had killed more than 100 militants in the past few days.

Al Qaeda-linked militants have often used motorbikes for armed attacks on military checkpoints in the past, as well as for some suicide attacks.

Last April, suspected al Qaeda gunmen on motorbikes attacked a military checkpoint outside Zinjibar, in the flashpoint southern province of Abyan. A passing shepherd was killed in that attack, a child wounded, and two soldiers were hurt, a local official said at the time.

Friday's incident came a day after authorities beefed up security at foreign missions and government sites in the capital Sanaa over warnings of a possible al Qaeda attack.

We have received information concerning plans by al Qaeda to move its operations to Sanaa, a security official told Reuters. We believe it is preparing to carry out these operations using car bombs any time soon.

Yemen is battling Islamist militants in the south of the country from Ansar al-Sharia (Partisans of Islamic Law).

President Abd-Rabbu Mansour Hadi took office in late February, vowing to fight the militants who had exploited political turmoil during the rule of his predecessor to make territorial gains.

Mass protests aimed at ending the 33-year rule of Ali Abdullah Saleh, long a key figure in Washington's fight against al Qaeda, erupted in early 2011.

Washington backed Saleh's succession under a deal engineered by top oil exporter Saudi Arabia, which fears chaos in Yemen could spread across its border.

The majority of attacks have taken place in southern Yemen, where most of Ansar al-Sharia's fighters are based. In their deadliest attack, militants killed at least 110 soldiers and took dozens hostage on March 4 in Zinjibar.

The government responded with air strikes and the United States has repeatedly used drones to attack militants.

(Additional reporting by Mohammed Ghobari in Sanaa; Writing by Firouz Sedarat; Editing by Andrew Osborn)