The reformer who won Thailand's election has failed to win enough votes in parliament to become prime minister.
Pita Limjaroenrat swept to victory in May as voters rejected nearly a decade of conservative military rule.
He has a lower house majority but could not win over enough unelected senators, all 249 of whom were appointed by a previous military government.
Mr Pita also faces last-minute legal challenges which could yet disqualify him. He denies breaking election rules.
"I accept it but I'm not giving up," he told reporters. "I will not surrender and will use this time to garner more support."
To no one's surprise, all but 13 senators opposed Move Forward, either abstaining or voting against its young leader. There were cheers from the crowd outside parliament every time a vote went in favour of him - groans and jeers when they went against.
In order to win the 42-year-old Harvard graduate and former tech executive needed the votes of more than half of the 749 members in parliament's two chambers, but he only secured 324 votes, 51 short of the required 375.
Under the rules, parliament keeps voting until a PM is elected - another vote is scheduled for next week. But it's not clear how Mr Pita can make up the shortfall.
Source: BBC