The election campaign for Afghanistan's next president officially kicked off on Sunday, two months before voting opens in a contest already plagued by violence and fraud but still the country's best hope of a somewhat stable future.

If it goes smoothly the April election will produce the first ever peaceful, democratic transition of power in Afghanistan. The incumbent, Hamid Karzai, is barred from standing again.

The historic nature of the vote underlines both what is at stake, and the size of the challenge in a country crippled by poverty and a raging insurgency even after more than a decade of international intervention.

"Eleven candidates, election campaigning and democracy. Makes me hopeful about Afghanistan. I hardly witnessed these in my lifetime," activist Wazhma Frogh, an outspoken critic of the government, said on Twitter.

Posters started going up around Kabul where campaigners defied a light drizzle, the teams unveiled spokesmen and campaign managers, the first rally dates were set, and social media platforms popular with the country's urban elite were already buzzing with support and criticism.

But the Taliban have vowed to disrupt an election they dismiss as a "waste of time" and violence began before the campaigning, with the assassination on Saturday of two men in Herat city.

Presidential hopeful Abdullah Abdullah, a former foreign minister, said they were part of his campaign team, and diplomats were quick to condemn the attack.

"The attack came at a critical moment for Afghanistan," said Jan Kubis, the top UN envoy to Kabul said in a statement. "This cowardly action constitutes a violent intimidation of electoral candidates and their supporters, and cannot be tolerated."

All 11 candidates have been issued with three armoured cars and more than 36 police officers as a personal guard for the duration of the campaign, and on Saturday they met members of the Independent Election Commission, which is organising the vote, to discuss security.

The other candidates range from a chatshow host and former airline pilot to the hardline Islamist who first invited Osama bin Laden to Afghanistan, and has an insurgency group in the Philippines named after him.

If none of them can get more than 50% of the vote on 5 April, a target that seems unlikely with such a wide field, there will be a second round that could push the final announcement of a new leader into the late summer.

Such an outcome worries foreign powers that support the country's government and military, with hopes that a new leader will sign a long-term security deal to keep American troops in the country.

After negotiating the bilateral security agreement, Karzai surprised Washington but also much of his own cabinet by demanding fresh concessions and refusing to sign.

Without it, promised aid worth billions of dollars is likely to dry up, and even a strong leader would struggle to hold together a country grappling with an insurgency, a feeble economy and massive unemployment, and a flourishing drug trade.

The president in Afghanistan wields huge powers, with little real opposition from a weak, fragmented parliament, and there is currently no frontrunner. With so much at stake, the race is expected to be intense, and most campaigns say they have already organised teams of monitors to look out for fraud by rivals on polling day.

Campaign spending is officially capped at 10m Afghanis (around $200,000), but in a country awash with money from opium and a lengthy military contracting boom, few expect that budget to be observed.

The top candidates beside Abdullah include an urbane mujahideen fighter close to assassinated commander Ahmad Shah Massoud and a technocrat intellectual who controversially bolstered his ticket with a popular mujahideen-era commander accused of war crimes, the incumbent's businessman brother, and another former foreign minister who is the only candidate to have put a woman on his ticket.

Karzai has not yet thrown his backing behind any of the candidates, saying his only contribution will be his single ballot as an Afghan citizen.

But as he intends to stay in Kabul after the vote, living a stone's throw from the palace, and will be dependent on his successor for security, he is expected to use his political and financial leverage behind the scenes.

The two-month campaign period ends on 2 April, then there is a "silent period" before polling day to allow voters to weigh up the campaigns.