Image copyright AFP Image caption Front-runners Gotabhaya Rajapaksa and Sajith Premadasa

Sri Lankans voted to choose a new president on Saturday, seven months after a devastating terror attack killed more than 250 people.

A total of 35 candidates were vying for votes in the presidential election, the third since the end of the country's decades-long civil war in 2009.

The current president, however, was not on the ballot.

Maithripala Sirisena decided against running after coming under criticism following the Easter Sunday bombings.

The attack by Islamic State group-linked militants in April, which targeted churches and high-end hotels across the island, left at least 253 people dead.

The government was forced to later admit it had suffered a "major intelligence lapse", with the defence secretary revealing an Indian intelligence warning from the beginning of the month about planned attacks was not properly shared by the authorities.

Image copyright Reuters Image caption After polls closed, election officials carried ballot boxes to counting centres

Just before polling got under way, gunmen opened fire on a convoy of buses carrying Muslim voters in the country's north-west. The perpetrators built a makeshift roadblock out of burning tyres, before shooting at the buses and pelting them with stones.

Police said there were no casualties, but two women were injured by the stones.

Meanwhile in the northern Jaffna peninsula, police said 10 men were arrested for "trying to create trouble".

Despite these incidents turnout was reported to be high, with election chief Mahinda Deshapriya saying it was over 80%.

Who could be Sri Lanka's next president?

Although there was a two-foot long ballot paper to accommodate all the candidates' names, this was an election with two clear frontrunners, one of whom has been accused of human rights abuses during his decade as defence secretary under his brother's presidential rule.

Gotabhaya Rajapaksa was in power when thousands of people - particularly Tamils - went missing in what have been described as enforced disappearances between 2005 and 2015.

But it was also his role in ending the civil war that boosted Mr Rajapaksa's fortunes after this year's Easter Sunday attacks.

Image copyright AFP

His tough stance on security impressed many in the country's Sinhalese Buddhist majority following the attack, with supporters choosing to overlook the various allegations against him - including questions over citizenship.

The importance of security to voters did not go unnoticed by his main rival, fellow frontrunner Sajith Premadasa. He launched his campaign with a promise that if he won, he would hire the army chief who defeated the Tamil Tigers, Sarath Fonseka, to oversee national security.

More about Sri Lanka and the Easter Sunday bombings

Media playback is unsupported on your device Media caption How the army finally crushed Tamil Tiger rebels after 25 years of bloody war

However, Mr Premadasa has more regularly focused on social issues, promising to eradicate poverty and improve housing.

Like his rival, he already has a loyal support base. The son of a president who was assassinated by Tamil Tiger rebels in 1993, he is the current housing minister and has managed to take on the Rajapaksa family in their own region.

Big choice for voters

Yogita Limaye, BBC News in Colombo

The ballot paper is the longest it has ever been in the country's history - 35 names. That's why the period for voting has been extended by an hour.

I met voters coming out of a Colombo polling station, their fingers inked after they cast their vote. Shahini Liyanagama, a first-time voter, said the Easter Sunday bombings weighed heavily on her mind.

"It was the first time I thought I could die, because one of the attacks was very close to my home. I think my country is very unstable at the moment, so I want that to change," she told me. Mohommad Farouk Mohodin, a senior citizen, said he voted for a "new line of thinking".

Many Sri Lankans believe the current government has failed to protect them, which is the big challenge for ruling party candidate Sajith Premadasa.

In the country's north where Tamil minorities live, there is the fear that Gotabaya Rajapaksa could win.

He is accused of human rights violations against Tamils. Kanagasabai Ratnasingham, 82, believes Mr Rajapaksa was behind the disappearance of his son in 2006. "If he comes to power, it will be dangerous for us," he told me.

Mr Rajapaksa has always denied the allegations against him and among many of the Sinhalese majority, he is seen as the strongman who ended the war.

What happened to the current president?

Maithripala Sirisena swept to power in a surprise victory against Mr Rajapaksa in 2015.

But he has decided not to try for a second term, with no explanation forthcoming.

However, he is increasingly unpopular with Sri Lankans. Evidence he may have disregarded intelligence about the Easter Sunday bombings came hot on the heels of a constitutional crisis sparked by Mr Sirisena sacking his own prime minister.

Media playback is unsupported on your device Media caption Outgoing Sri Lankan President Maithripala Sirisena: IS 'chose Sri Lanka to show they exist'

And then there were a number of bizarre rants - about the cashew nuts on board Sri Lanka's national carrier, for example, and about the organisers of a gig by Spanish pop star Enrique Iglesias, whom Mr Sirisena said should be whipped.

But what do voters care about?

National security was arguably the biggest issue. However, equality for minorities and unemployment also played on voters' minds.

AFP Sri Lanka's presidential election What you need to know 16 million Sri Lankans eligible to vote

35 Number of candidates vying for the top job

Two foot Length of ballot paper

74.32%Average turnout at previous votes Source: electionguide.org

But the two candidates also promised something different on the international stage. Mr Rajapaksa said he planned to "restore relations" with Sri Lanka's top lender, China, if he wins the election. This may have been controversial in some circles, due to concerns over the size of Sri Lankan debt to the Asian superpower.

Mr Premadasa, meanwhile, was seen as leaning more towards India and the US.

When will we know the results?

There was only one round in the election but voters could choose up to three candidates in order of preference. If no candidate wins more than 50% of the vote, the winner among the top two is determined after tallying the second preferences of voters.

Results are expected on Sunday if one candidate secures more than 50% of the vote, but flooding in three of the 22 electoral districts disrupted counting, and could delay the results.

If there is no clear winner and second preferences need to be counted, then the results will arrive on Monday.