Yemen's President-elect Abdrabuh Mansur Hadi arrives to take the oath of office during the swearing-in ceremony at the parliament in Sanaa on February 25, 2012 ahead of formal handover of power by veteran strongman Ali Abdullah Saleh. (MOHAMMED HUWAIS/AFP/GETTY IMAGES)

Hours after Yemen’s new president was sworn in, formally ending President Ali Abdullah Saleh’s 33-year rule, a car bomb exploded outside a presidential compound in southern Yemen, killing at least 25 people, security officials said Saturday.

The attack underscored the challenges facing the country’s new leader, former vice president Abed Rabbo Mansour Hadi, who in a televised inauguration speech vowed to fight al-Qaeda and restore security to this impoverished Middle East nation.

Earlier in the day, Saleh returned to Yemen after a three-week-long trip to the United States, where he received medical treatment for injuries suffered in an assassination attempt last year.

Yemeni officials said Saleh, the fourth Arab leader ousted in the revolts of the past year, did not return to the presidential palace but to a personal residence. But many Yemenis fear that he will remain influential behind the scenes, and his return heightened those concerns.

No group asserted responsibility for Saturday’s attack, which took place in the city of Mukalla in Hadramout province. But Yemeni security officials said it bore the hallmarks of an al-Qaeda affiliate, al-Qaeda in the Arabian Peninsula, which U.S. officials consider one of the biggest threats to the United States.

The Associated Press quoted a witness as saying that a pickup truck approached the gate of the presidential compound and exploded as soldiers were coming out, suggesting that it was a suicide attack. The explosion was followed by heavy gunfire from the surviving soldiers.

Southern Yemen has long been a cauldron of animosity toward Yemen’s weak central government. Radical Islamists linked to al-Qaeda have taken over large swaths of territory, taking advantage of the political turmoil over the past year, as a populist uprising sought the end of Saleh’s rule. Southern secessionists are angry that Hadi’s new unity government has not addressed their grievances.

In his speech, Hadi vowed to return thousands of Yemenis displaced by conflict to their homes. “One of the most prominent tasks is the continuation of war against al-Qaeda as a religious and national duty, and to bring back displaced people to their villages and towns,” he said.

On Tuesday, Yemenis came out in large numbers to vote for Hadi, who ran uncontested in an election intended to give him popular legitimacy and signal an end to Saleh’s rule. Election officials on Friday said that 6.6 million Yemenis voted for Hadi out of a total of 10.2 million registered voters.

Independent youth activists, who spearheaded Yemen’s revolution, have denounced the vote, which was backed by the United States and Europe, as a sham that keeps much of Saleh’s regime intact. Hadi was Saleh’s handpicked successor and served as his second in command for more than 17 years.

The vote was a condition of a U.S.-backed power transfer deal, crafted by Yemen’s Persian Gulf neighbors, that sought to head off political chaos that could strengthen the presence of al-Qaeda in the Arabian Peninsula. The group has been involved in several attacks on American territory since 2009, including an attempt to blow up a Detroit-bound airliner.

Hadi urged Yemen’s political parties and other centers of power to follow a democratic path to end the nation’s 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 racked the country,” he said.