Updated on May 10 at 7:20 a.m. ET

Voters in the Philippines all but elected a new president on Monday, a tough-talking mayor who transformed a southern city with a populist combination of controversial tactics and a deft touch.  

With about 90 percent of the vote counted, Davao Mayor Rodrigo Duterte had about 39 percent of the vote. His nearest rival, Manuel “Mar” Roxas, the scion of a political dynasty, had 23 percent. Roxas conceded on Tuesday.

Duterte, a 71-year-old prone to explitive-laced rants on the campaign stump, was swept into office on a primarily law-and-order platform. During his 22 years as the mayor of Davao, a city of 1.4 million in the southern part of the country, Duterte oversaw a dramatic decrease in crime. His public life has been shaped by the violence that plagued his city, making it the murder capital of the Philippines when he first took office in 1988. Some dubbed Davao the “Nicaragua of Asia,” because of clashes between communist rebels and state security forces.

Today, the city on Mindanao island is celebrated as one of the safest in the Philippines. Even as Muslim militants connected to al-Qaeda terrorize other parts of the island, Davao remains “an oasis of peace in the middle of the Philippines’ lush center of chaos,” Time magazine described in a 2002 profile of Duterte.

“The only reason there is peace and order in Davao is because of me,” he told Time, saying he personally oversaw policing in his tenure by “thrashing” drunken cops, while also giving officers groceries as an incentive not to accept bribes. He said he personally told rebel groups he would kill them if they came into the city, and ordered his officers to kill people who resisted arrest.

Duterte would patrol the city on a motorcycle or undercover as a taxi driver. He also set up closed-circuit television cameras across Davao, banned the sale of liquor from 1 a.m. until 8 a.m., and implemented strict speed limits.

Time also wrote:

By the early 1990s, the threat within Davao from communist rebels and Muslim guerrillas had faded. Duterte’s vigilance had not. Urchins caught picking pockets have got beatings with a belt or a cow’s tail from the mayor himself, often in City Hall. Rich kids who hot-rodded down the city streets were warned that they’d be paraded naked around town. And throughout, he let it be known that he would never relent in his fight against rapists, petty thieves and particularly drug pushers. “If you sell drugs to destroy other people’s lives,” he threatened, “I can be brutal.”

That brutality at times meant using so-called “death squads,” extrajudicial groups that have allegedly killed thousands of people during Duterte’s tenure. In a 2009 report, the Human Rights Watch said that most victims of the killings are alleged drug dealers, petty criminals, and street children who may have connections to gangs.

Duterte proudly acknowledges helping kill 1,700 criminals through these groups. “How do you think I did it?” he said in a speech last May. “How did I reach that title among the world’s safest cities? Kill them all.”

Even on the campaign trail, he said he would dump the bodies of criminals in Manila Bay if he were elected president, promising to end crime in the country in six months by killing up to 100,000 more criminals. “All of you who are into drugs, you sons of bitches, I will really kill you,” he said this month. “I have no patience, I have no middle ground, either you kill me or I will kill you idiots.”

Duterte, who was elected seven times as Davao mayor, is a man of apparent contradictions. While he has run almost entirely a law-and-order campaign, a political opponent accused him of not declaring $51 million, allegedly accumulated from the salaries of 11,000 government workers that do not exist. He has been criticized heavily on the campaign trail for kissing women and being a womanizer, yet he has been a consistent advocate for women’s rights while he was mayor. He’s joked about the rape and murder of an Australian missionary in 1988 in his city, but he also has said he was sexually abused by a priest when he was younger.

And while his no-tolerance policies on crime and controversial public statements would suggest otherwise, during his time as mayor he helped institute several social policies that were progressive firsts in the Philippines. Davao was the first city to ban smoking in public (Duterte once forced a tourist to eat a cigarette butt for refusing to follow the ban). It was also the first city to create a 9-1-1 phone line and call center that worked effectively.

In 2012, he helped pass an anti-discrimination law to expand LGBT rights in a widely Catholic and socially conservative country. During this time as mayor, he would also send food to Muslim families during Ramadan, the Muslim holy month.

Even as this election was a race of soundbites and insults, most especially surrounding Duterte’s bravado, as president he will have to deal with several pressing issues facing the Philippines, including increasing tensions with China over territorial claims in the South China Sea. Duterte’s solution: He has promised to take a jet ski out to many of those contested islands and personally face off against the Chinese. The Philippines also faces high levels of poverty despite its impressive recent economic growth, and he faces the future of the country’s military cooperation with the United States.

President Benigno Aquino, who had campaigned against Duterte, is barred from seeking a second term by term limits. Presidents of the country of 100 million are limited to one, six-year term. However, on the campaign trail, Duterte suggested he might abolish the country’s legislature if he were elected president, which have led some to fear the return of a military dictatorship. It doesn’t help that his vice presidential running mate is the son of the country’s late dictator, Ferdinand Marcos, who ruled for two decades until his ouster in 1986.  

Dutrete was gracious in victory.

“It’s with humility, extreme humility,” he told AFP, “that I accept this, the mandate of the people.”