President Recep Tayyip Erdogan's AKP had claimed there were "irregularities and corruption" behind the opposition CHP's slim win.
But CHP's Ekrem Imamoglu, who was confirmed as Istanbul's mayor in April, called the decision "treacherous".
The vote, which will be held on 23 June, has sparked protests in the city.
Hundreds of residents gathered in several districts of Istanbul on Monday, banging pots and pans and shouting anti-government slogans.
The European Parliament also said the decision to re-run the election would end the credibility of democratic elections in Turkey.
Why is the vote being re-held?
An AKP representative on the electoral board, Recep Ozel, said the re-run was called because some electoral officials were not civil servants and some result papers had not been signed.
But CHP deputy chair Onursal Adiguzel said the re-run showed it was "illegal to win against the AKP".
Mr Adiguzel tweeted that the decision was "plain dictatorship".
"This system that overrules the will of the people and disregards the law is neither democratic, nor legitimate," he wrote.
And in a speech broadcast on social media, Mr Imamoglu condemned the electoral board, saying they were influenced by the ruling party.
"We will never compromise on our principles," he told the crowd. "This country is filled with 82 million patriots who will fight... until the last moment for democracy."
A supporters' group for Mr Imamoglu urged restraint, saying: "Let's stand together, let's be calm... We will win, we will win again."