Story highlights

NEW: Two attacks kill eight police on day new President takes the oath of office

NEW: One of the attacks killed four officers a few miles from the presidential palace

Ashraf Ghani succeeds Hamid Karzai, who was in power for 13 years

Ghani's swearing-in comes after the recent resolution of a lengthy dispute with his rival

CNN  — 

Ashraf Ghani was sworn in Monday as Afghanistan’s President, sealing the country’s first peaceful democratic transition of power.

Ghani, a former finance minister, takes office after signing a power-sharing deal last week with his rival presidential candidate, Abdullah Abdullah.

He succeeds Hamid Karzai, who experienced a rocky relationship with the United States during his 13 years in power that began after the fall of the Taliban.

A reminder of the challenges facing Ghani and Afghanistan came a few miles away from the presidential palace in Kabul: A suicide bomber targeting a police checkpoint killed four police officers and three civilians Monday morning, said Sediq Sediqqi, a spokesman for the Afghan Interior Ministry.

Elsewhere in Afghanistan, three suicide bombers killed four Afghan police officers Monday at a district police headquarters in the eastern Paktia province, Sediqqi said.

Ghani and Abdullah had been locked in a lengthy dispute amid accusations of voting fraud and manipulation, raising fears of increased instability in the fragile, war-torn country.

Under the agreement, Abdullah, a former foreign minister who later became a vocal critic of Karzai’s, will take a newly created position of chief executive officer, which will have similar functions to a prime minister.

The deal also calls for the two leaders’ teams to share senior government positions equally.

Some commentators have suggested the two rivals may have difficulty working together in government after months of bad blood between them.

The political impasse in Afghanistan this year had come as the Taliban continued to mount deadly attacks on high-profile targets and fought fiercely for control of important areas.

As the U.S.-led war effort against the militants winds down, most NATO troops are due to withdraw from Afghanistan by the end of this year.

CNN’s Masoud Popalzai contributed to this story