Tens of thousands gathered at the national mosque in Jakarta for mass prayers on Saturday urging Indonesians to vote for Muslims in city and district elections being held across the country next week.

The crowds overflowed from Istiqlal Mosque in the heart of the capital into the surrounding streets. Clerics gave sermons calling on people to protect Islam and to vote for Muslim candidates.

Police have denied hard-line groups permission to march through the city. Jakarta police spokesman Argo Yuwono estimated the crowds at 60,000 to 70,000 people.

Protests against the minority Christian governor of Jakarta drew hundreds of thousands to the city's streets in November and December and shook the government of President Joko "Jokowi" Widodo.

Gov. Basuki "Ahok" Tjahaja Purnama is on trial for alleged blasphemy but remains a leading candidate in elections for Jakarta governor set for Wednesday.

If none of the contenders gets more than 50 percent of votes, a runoff election between the top-polling candidates would be held in April.

Indonesia is the world's most populous Muslim nation but recognises several faiths and has a large Christian minority.