Updated

Despite allegations of corruption and concerns about authoritarianism, Turkey's local elections have given Prime Minister Recep Tayyip Erdogan momentum that could see him start a campaign to become the country's first directly elected president.

Erdogan's ruling party swept municipal elections on Sunday, gaining 45.5 percent of the votes and retaining the key city of Istanbul. The party was also leading in Ankara, but votes were close and were likely to be contested.

Analysts say the result amounts in a vote of confidence for Erdogan and will encourage him to run for presidential elections in August, where he would have to win 50 percent of the votes.

Erdogan's presidential aspirations were put in doubt after last year's anti-government protests, a corruption scandal and unpopular moves to block Twitter and YouTube.