Czech Prime Minister Vladimir Spidla is standing down as the head of government and leader of his party.
Spidla's move would prompt the collapse of the entire cabinet
His resignation came shortly after he narrowly survived a vote of confidence by his Social Democratic Party.
More than 100 of Mr Spidla's opponents voted against him, but they failed by six votes to gain the three-fifths majority needed to remove him.
The vote was called after a disastrous showing by the party in the European elections earlier this month.
The Social Democrats won only two of 24 seats at stake.
Mr Spidla said after the party vote: "When it became apparent I did not have the support of my own party, I decided could not continue.
"I will inform the Cabinet of the resignation on Wednesday," he told a news conference.
Mr Spidla's announcement came after a day of dramatic twists and turns at the meeting of the Social Democrats central executive committee, the BBC's Rob Cameron in Prague reports.
Mr Spidla survived the confidence vote, but it was a pyrrhic victory as more than half of the delegates still voted against him.
That was enough to convince the prime minister he could no longer carry on, our correspondent adds.
The three-party coalition government led by the Social Democrats holds a fragile majority of one vote
in the lower chamber of Czech parliament.
It is expected to resign en masse on Wednesday.
What happens now depends on two men - President Vaclav Klaus, who must appoint a new prime minister, and Interior Minister Stanislav Gross, Mr Spidla's main opponent within the ruling Social Democrats, our correspondent says.
Mr Gross is now likely to take over as party leader, our correspondent says.
Mr Gross favours a minority left-wing government with the support of one or more opposition parties.
But critics say Mr Gross, who is 34, is too young for the job.
All this indicates that a government could be hard to assemble, and the Czech Republic now enters a period of political instability, analysts say.