BANGKOK, July 15 (AFP) - The liberal frontrunner to become Thailand's next prime minister said Saturday he would withdraw his candidacy if parliament did not endorse him next week, after military-appointed lawmakers foiled his first attempt.

Pita Limjaroenrat's Move Forward Party (MFP) won the most seats in May elections, buoyed by young Thais eager for progressive reforms after nine years of army-backed rule in the kingdom.

But the Harvard-educated millionaire's campaign to lead the next government was knocked back Thursday by senators in parliament who consider his pledge to reform strict royal defamation laws a red line.

The legislature holds its second ballot for a new prime minister on Wednesday, and Pita said he would support a candidate from coalition partner Pheu Thai if he failed to win the needed votes again.

"I'd like to thank every support and encouragement from the people but I'd like to apologise that we haven't succeeded," he said in a video address posted to social media.

"I'm ready to give a chance to Thailand by letting the party that has the second most votes... be the one to form the coalition."

Pita was 51 votes short of the 375 lawmakers he needed to support his candidacy during the first ballot.

Just 13 senators voted for him, with many voicing their opposition to MFP's pledge to soften the kingdom's royal defamation laws.

After the first ballot, the party ruled out compromising on its promise to revise the laws, which allow convicted critics of the monarchy to be jailed for up to 15 years.

- 'Help with this mission' -

All 250 senators were appointed under the junta-drafted constitution, which political analyst Thitinan Pongsudhirak said was a reliable impediment to MFP's reformist platform.

"It is a way for the authority and the regime to stay in power in the long term and to prevent a pro-democracy government that can stand against them," he told AFP on Friday.

Pita urged his supporters on Saturday to get "creative" in urging senators to throw their support behind him in the next round.

"I alone can't change the senators' mind. Therefore, I ask everybody to help with this mission," he said.

"Send a message to the senators in every way possible, every way you can think of."

The MFP's largest coalition partner Pheu Thai is seen as a vehicle for the Shinawatra political family, whose members include two former prime ministers displaced by military coups in 2006 and 2014.

Property tycoon Srettha Thavisin, 60, is widely tipped to be Pheu Thai's candidate for prime minister if Pita's bid fails again.

Liked by business leaders among Thailand's influential elite, he has been touted as a potential compromise candidate.