Indonesians lined up on Wednesday to vote in an election to choose between a Muslim and a Christian candidate to govern Jakarta, after a bruising campaign marred by religious tensions in the capital of the world's third-largest democracy.

The vote is expected to be a close race between the incumbent, Basuki "Ahok" Tjahaja Purnama – the city's first Christian and ethnic-Chinese leader – and a former education minister, Anies Baswedan, who like 85 percent of Jakarta's residents, is Muslim.

Security appeared light at several polling stations, though police said 66,000 personnel would be deployed in the city of some 10 million people.

The election is viewed as a test for Indonesia's young democracy and record of religious tolerance, with both sides raising concerns about intimidation and voter fraud.

"Don't let any cheating happen, because the future of Jakarta is determined by the election today," Purnama told reporters after voting with his family in North Jakarta.

"The military and the police have guaranteed safety, so don't be afraid," he added on Metro TV, dressed in a plain white shirt rather than the trademark checkered shirt worn by his supporters.

Authorities in a neighbouring province on Java island searched private cars and public buses heading for Jakarta on Tuesday for sharp objects and explosives.

Given Jakarta's outsized importance as both the nation's capital and commercial centre, the election is also viewed as a barometer for a 2019 presidential election.

Purnama is backed by President Joko Widodo's ruling party.

Religious tensions have been an undercurrent in the campaign, with Purnama on trial for blasphemy over comments he made last year that many took to be insulting to Islam.

Hundreds of thousands of Muslims took to the streets late last year to call for his sacking and to urge voters not to elect a non-Muslim leader. One person died and more than 100 were injured after one protest turned violent.

Purnama faces up to five years in jail if convicted of blasphemy. His trial will resume on Thursday, when prosecutors will submit their sentence request.

Baswedan, is backed by a conservative retired general, Prabowo Subianto, who lost to Widodo in a 2014 presidential vote.

"My hope is for peace ... no disorder," said one voter, Suti, who cast her ballot at the South Jakarta polling station where Baswedan is due to vote and, like many Indonesians, goes by one name.

About 7 million people are eligible to vote until 1 p.m. (0600 GMT), when polling stations close.

Private pollsters, approved by the national elections commission, are expected to announce an unofficial tabulation of a sample of votes, known as "quick counts", within a few hours of polls closing. The elections commission is expected to announce official results by the first week of May.

The loser can contest the results in the Constitutional Court, which could prolong political uncertainty for weeks.

Citigroup said in an investor note that, despite the potential for renewed protests if Purnama won, it was maintaining a Jakarta stock index target of 6,150 by the end of 2017, up from around 5,600 now.

"As long as there are no security issues, the election outcome should not significantly stall the reform programme of the national government, in our view," it said.