The US ambassador to the Philippines has apologised for saying that 40% of male tourists visit the country for sex.

Ambassador Harry Thomas sent a text message to the Philippine foreign secretary, Albert del Rosario, expressing regret for his comments, which provoked an outcry among officials unhappy at their country being portrayed as a haven for sex tourists.

"I should not have used the 40% statistic without the ability to back it up. I regret any harm that I may have caused," Thomas said in the text message, which was released to journalists.

The US embassy spokeswoman Tina Malone said Thomas "offered his deep regret" for his comment made during a conference last month.

The US would continue to be a "strong and dedicated partner of the Filipino people in combating the global scourges of human trafficking and sexual tourism", she added.

Thomas also told the conference on human trafficking in the Philippines last month that the sex tourists included Americans and that it was "something I'm not proud of". He urged Philippine authorities to prosecute all foreign sex tourists, including Americans.

The Philippines is trying to revive its tourism industry and erase its reputation as a sex tourism hotspot.

As a former US colony, the Philippines hosted American bases until the early 1990s, and communities around the military facilities became havens for prostitution that catered to American servicemen.

This week the justice secretary, Leila de Lima, wrote to Thomas seeking further information about his data after the ambassador said the justice department was the source of his information.

De Lima told reporters such comments from a diplomat were offensive and demeaning since they portrayed the Philippines as a "country of sex workers".