The decision by Turkish authorities to wipe away a stinging defeat for President Recep Tayyip Erdogan and rerun the election for mayor of Istanbul left the opposition angered but determined on Tuesday to win the race a second time.

Ekrem Imamoglu, the opposition candidate who narrowly won the March 31 election, only to have that victory annulled on Monday, announced on Tuesday that he would run again, and rallied his supporters by retweeting a message from his party’s Twitter account that said, “We will win again.”

The move by Mr. Erdogan to overturn the election results quickly reverberated through Turkey and beyond. Sporadic protests broke out Monday evening after the announcement, and the lira, a barometer of the way foreign investors regard the country, declined sharply on Tuesday — down 5 percent from earlier in the week.

The decision by the High Electoral Council, which cited irregularities in how officials were chosen to oversee voting at some polling stations, left the opposition with the difficult decision of whether to take part in a new election that it considers illegitimate.