A presidential election in the Philippines could go down to the wire after an offensive gaffe by frontrunner Rodrigo Duterte about a rape victim caused outrage and could mean losses of crucial swing votes with just three weeks to go.

A clip appeared on YouTube over the weekend of Duterte at a recent rally recalling a 1989 prison riot in which an Australian missionary was killed, and inmates had lined up to rape her.

https://www.youtube.com/watch?v=cUMGJNGEzt8

In what sounded like a joke, Duterte said the victim was “beautiful” and as mayor of Davao city where it took place, he should have been first in the queue. “He crossed the line,” said Ramon Casiple of the Institute for Political and Electoral Reforms in the Philippines. “He may have given Poe the keys to the presidency.”

Social media users expressed their outrage and echoed comments by Duterte’s opponents denouncing him as crass and unfit to be president. The tough-talking mayor has the edge in opinion polls over Senator Grace Poe but as condemnation poured in for a second day, focus shifted to whether Duterte’s remarks and his refusal to apologize could cost him the presidency.

Australian ambassador to the Philippines Amanda Gorely said rape “should never be joked about” and U.S. counterpart Philip Goldberg said his country would not condone any statement anywhere that trivialized rape and murder.

Duterte has cultivated an image as a crime-busting political hard man and his inflammatory campaign speeches and no-holds-barred approach have endeared him to many Filipinos.

Poe’s running mate, Francis Escudero, said he expected it would see Duterte lose “soft votes”, or 5-8 points in polls.

Duterte moved ahead of schoolteacher-turned-senator Poe in opinion polls last week, but experts said the comment could be decisive in a tight race and push undecided women voters towards his main opponent.

“He has been testing the limits of civility … but he’s unleashed a hornets’ nest with this rape joke,” said Julio Teehankee, dean of political science at Manila’s De La Salle University.

“This will have an impact on him and it’s too close, three weeks to go, then you make this major blunder. Last week, the momentum was on his side, he was about to break away.”

Duterte reiterated his comment was taken out of context and refused to apologize for repeating words he had used in anger in 1989. He regretted the “gutter language” he used, but said that was part of his tough upbringing.