South Korea's governing Democratic Party has suffered a crushing defeat in mayoral elections in the country's two biggest cities, Seoul and Busan.
Candidates from the opposition People Power Party (PPP) won both cities by big margins.
Both former mayors from President Moon's Democratic Party were accused of sexual misconduct while in office.
In Busan, the incumbent resigned. Seoul's mayor was found dead in a suspected suicide.
The vote is seen as an important barometer of public opinion ahead of a presidential election next year.
The popularity of President Moon Jae-in and his party has plummeted to record lows in recent months due to sex abuse scandals, rising house prices and deepening inequality.
Tens of millions voted to elect chiefs of the two cities, with 21 local offices also contested.
Both mayoral offices became available when their incumbents were caught up in sex abuse scandals.
Park Won-soon was mayor of Seoul and was seen as a possible presidential candidate when he committed suicide in July. His death came just a day after his secretary made a police complaint about his behaviour.
Busan mayor Oh Keo-don resigned last year after a female public servant accused him of sexually assaulting her in his office.
Oh Se-hoon of the PPP defeated Park Young-sun by 57.5% to 39% to claim the Seoul mayoral seat, according to the final vote tally released by the National Election Commission, the Yonhap news agency reports.
The mayor's office also went to the opposition in Busan, with Park Heong-joon beating Kim Young-choon 63% to 34%.
The result suggests a resurgence for the conservative opposition, which was hit hard by the impeachment in 2017 of then-President Park Geun-hye. Park is serving a 20-year sentence for abuse of power and coercion.