Rodrigo Duterte, the man known for joking about rape and pledging to kill criminal suspects, has been elected as president of the Philippines.

"Our people have spoken and their verdict is accepted and respected," outgoing President Benigno Aquino III's spokesman Sonny Coloma said in a statement. "The path of good governance ... is already established as all presidential candidates spoke out against corruption."

Mr Duterte’s victory had been clear before the official result had been announced, with the 71-year-old’s main rival, the former Interior Secretary Mar Roxas, conceding defeat. "Digong, I wish you success," Roxas said at a news conference, using Duterte's nickname. "Your victory is the victory of our people and our country."

Mr Duterte, 71, said he will take up his new role with “extreme humility,” the BBC reported.

In the election for vice president, who is separately elected in the Philippines, the son of late dictator Ferdinand Marcos was trailing by a hair to a political neophyte, Rep. Leni Robredo, who is backed by the outgoing president.

The election has seen Mr Duterte thrust himself into national politics for the first time after 22 years as mayor of Davao, a city on the southern main island of Mindanao, before which he was known as a government prosecutor.

In those two jobs, Duterte gained notoriety by going after criminals, although he was accused of carrying out hundreds of extra-judicial killings. His past has earned him the nicknames of “The Punisher” and “Duterte Harry,” a reference to the Clint Eastwood movie character with little regard for rules, while his inflammable statements have caused many to term him “The Donald Trump of the East”.

Philippines polls: Rodrigo Duterte headed for victory

He has made speeches peppered with rape jokes and anecdotes about his Viagra-fuelled sexual escapades, and with undiplomatic remarks about Australia, the United States and China, all of which are key players in the country’s politics.

He once made a joke about wanting to have been the first person to have raped an Australian missionary who was gang raped and killed by inmates in a 1989 jail riot. When he was criticised by both the Australian and American ambassadors to the Philippines, he told them to shut up.

He said he would talk with China about territorial disputes in the South China Sea but if nothing happened, he would sail to an artificial island newly created by China and plant the Philippine flag there. China, he said, could shoot him and turn him into a national hero.

He has also threatened to form a one-man rule if legislators in the Congress oppose him, and on Monday, when he was asked to comment about his image as a mass-murder advocate, he replied: "I'm sure that there will be a resurrection one of these days." He did not elaborate further on the comment.