SANAA, Yemen - A car bomb outside a presidential compound in southern Yemen killed at least 25 people yesterday, hours after the country's new president was formally inaugurated and vowed to fight al-Qaida.

A security official said the attack in the city of Mukalla, Yemen's fourth-largest city, was carried out by a suicide bomber and that it bore the hallmarks of an al-Qaida operation. Both al-Qaida and southern separatists are active in the region.

A health official confirmed the death toll. Both officials spoke on condition of anonymity as they were not allowed to speak to the press.

The blast came hours after Abed Rabbo Mansour Hadi was sworn in as president to replace longtime leader Ali Abdullah Saleh, following an election aimed at ending more than a year of political turmoil in Yemen. Hadi was the only candidate in the election.

In his televised speech before parliament, Hadi vowed to keep up Yemen's fight against al-Qaida militants, who have taken advantage of the country's political turmoil to seize control of towns and swaths of territory in the country's restive south.

"One of the most prominent tasks is the continuation of war against al-Qaida as a religious and national duty, and to bring back displaced people to their villages and towns," Hadi said.

Hours after Hadi spoke, the blast rocked Mukalla in the province of Hadhramaut, part of formerly independent south Yemen, which united with the north in 1990.

Ahmed al-Rammah, who witnessed the blast, said he saw a pickup truck moving slowly toward a gate at the presidential compound as soldiers were coming out. Then it exploded, he said. The blast was followed by heavy gunfire from the surviving guards.

The province is one of many in southern Yemen wracked by violence in the wake of anti-Saleh protests over the past year. Many accuse the longtime ruler of allowing security to collapse as a way of pressuring Western governments and neighboring Gulf countries into keeping him in power.

Under international pressure late last year, Saleh signed a Gulf-brokered and U.S.-backed agreement that gave him immunity from prosecution for the deaths of hundreds of people in last year's turmoil in exchange for handing over powers to Hadi, his deputy at the time.

Hadi now faces a slew of challenges as he tries to bring stability to Yemen. He must restructure powerful security forces packed with Saleh loyalists, launch a national dialogue that would include southern secessionists, and appease a restless religious minority in the north as well as disparate opposition groups in the heartland. He takes power with a popular mandate bolstered by the unexpectedly large turnout - 65 percent - for Tuesday's vote.

Washington has played an active role in the transition, hoping that Hadi can head off chaos and ensure cooperation against the country's active al-Qaida branch.

Hadi called on all political parties to abide by democracy as a means to take Yemen out of its crisis. "Expected changes don't come by mere wishes and hopes but through democratic dialogue, and through a serious and correct approach to the key issues that rack the country," he said. The ceremony was attended by the U.S. and EU ambassadors, and several Arab envoys.