The controversy has sparked protests, prompted the resignation of the country's election chief and raised concerns about the integrity of the voting process.