The Czech Republic has been plunged into uncertainty, as President Milos Zeman was rushed to hospital a day after his ally, populist billionaire Prime Minister Andrej Babis, narrowly lost an election.

The president, who plays a critical role in nominating any future prime minister, was taken to hospital by ambulance shortly after meeting Mr Babis and appeared to be unconscious upon arrival, with someone seen holding up his head.

His doctor said he was in intensive care, while the Blesk tabloid quoted Zeman's office head Vratislav Mynar as saying that he "fell asleep during the transport, that's all. He wasn't unconscious".

Mr Babis is hoping to hold on to power despite being defeated by the centre-right Together alliance, which has said it is ready to form a majority government with another grouping.

But the timetable for any post-election talks has been thrown into confusion by the condition of the president, who has been grappling with liver problems according to local media and politicians.

"At the moment, the patient is hospitalised at an intensive care unit of Prague's Military University Hospital," Mr Zeman's doctor and head of the hospital, Miroslav Zavoral, told reporters.

He said Mr Zeman had not allowed him to disclose his diagnosis.

The president had cast his ballot in his official residence because of health problems less than a month after he spent eight nights at the military hospital.

Mr Zeman's office has been secretive about his illness, giving no details for weeks.

Milos Zeman pictured as he delivered a speech at Prague Castle during a ceremony in May to remember Covid-19 victims

Under the Czech constitution, the authority to nominate the new prime minister falls to the speaker of the newly elected lower house of parliament if both houses of the body declare the president unable to perform his duties.

The Together alliance of the right-wing Civic Democrats, the centre-right TOP 09 and the centrist Christian Democrats won 27.79% of the vote, while Mr Babis's ANO party earned 27.12%.

The alliance would have a majority of 108 seats in the 200-seat parliament together with another grouping comprising the anti-establishment Pirate Party and the centrist Mayors and Independents.

Together leader Petr Fiala said the two alliances would only talk about a government with each other and ask Mr Zeman to tap him to form the government.

A day after voting in Prague, Zdenek Klima told AFP he was "absolutely excited" with the outcome.

"Owing to the new government, we will finally be where we historically belong," he beamed.

Analysts saw the election result as a blow to populism.

"It's a victory not only for the Czech Republic, but for the whole of Europe," Jiri Priban from Cardiff Law School said on Czech TV.

"It's a proof that even if the populists can't be entirely defeated, their advance can be stopped and reversed," he added.

Communists out

Michal Klima, an analyst at the Metropolitan University in Prague, said the country faced "Orbanisation" with Mr Babis at the helm, referring to Hungarian populist leader Viktor Orban who came to Prague to give Mr Babis a boost before the vote.

"This result shows a certain return of stability," Mr Klima said.

Mr Babis currently leads a minority government with the Social Democrats, which was until recently tacitly backed by the Communist Party that ruled the former totalitarian Czechoslovakia from 1948 to 1989.

But the Communists were ousted from parliament at the polls for the first time since World War II, and the Social Democrats also failed to meet the five-percent threshold for parliament entry.

The 67-year-old Babis, a food, chemicals and media mogul, is facing police charges over alleged EU subsidy fraud and the bloc's dismay over his conflict of interest as a businessman and a politician.

Last weekend, the Pandora Papers investigation showed he had used money from his offshore firms to finance the purchase of property in southern France in 2009, including a chateau.

He has denied any wrongdoing and slammed the allegations as a smear campaign.