Afghanistan inaugurated its first new president in a decade yesterday, swearing in technocrat Ashraf Ghani Ahmadzai to head a power-sharing government just as the withdrawal of most foreign troops presents a crucial test.

The first democratic handover of power in Afghan history has been far from smooth: the deal for a unity government was cobbled together after months of deadlock over a vote in which both Ghani and opponent Abdullah Abdullah claimed victory.

Illustrating the problems facing the new president, a suicide bomber killed seven people at a security checkpoint near Kabul airport just before Ghani was sworn in, a government official said. The Taliban claimed responsibility.

Later, ending months of uncertainty over the future US role in Afghanistan, the US embassy announced Ghani would today send a representative to sign a security agreement with the United States allowing a small contingent of troops to remain.

In his inaugural speech, Ghani appealed to the Taliban and other militants to join peace talks and put an end to more than a decade of violence. Thousands of Afghans are killed each year in the insurgency. “Security is a main demand of our people, and we are tired of this war,” Ghani said. “I am calling on the Taliban and Hezb-i-Islami to prepare for political negotiations.”

Hezb-i-Islami is an Islamist faction loosely allied with the Taliban.

Ghani also vowed to crack down on rampant corruption and called for cooperation within the coalition government.

“A national unity government is not about sharing power, but about working together,” Ghani said in his speech that lasted for nearly an hour.

But signs of tension are already appearing in the fragile coalition. A dispute over office space and whether Abdullah would speak at the inauguration led to threats his camp would boycott yesterday’s ceremony, an Abdullah aide said, adding it was resolved after late-night meetings with the US ambassador.

The inauguration marks the end of an era with the departure of President Hamid Karzai, the only leader Afghans have known since a US-led invasion in 2001 overthrew the Islamist Taliban who had given sanctuary to al-Qaeda.

Sign up to our free newsletters

Get the best updates straight to your inbox:
Please select at least one mailing list.

You can unsubscribe at any time by clicking the link in the footer of our emails. We use Mailchimp as our marketing platform. By subscribing, you acknowledge that your information will be transferred to Mailchimp for processing.