After a terse cabinet meeting, Mr Rao drove to the presidential palace for his last official act as Prime Minister. Mr Rao, 74, now also faces the prospect of being ousted as Congress party leader. He refused to give any statement after his resignation.
Mr Rao will act as caretaker until a new governing coalition can be forged, which could take weeks. No clear winner has risen from these elections.
The President, SD Sharma, today will have two lots of politicians knocking on the door of his palace trying to stake a claim to form a government.
First will be a group led by Atal Behari Vajpayee, from the Hindu revivalist Bharatiya Janata Party (BJP), which is emerging as the largest single party in parliament. But with only 175 seats expected, the BJP and its allies are flailing to reach a majority in the 543-seat Lok Sabha (parliament).
The BJP's combustible mix of religion and politics, in a country teeming with faiths, languages and cultures, may keep potential coalition partners away. But even the BJP's foes regard Mr Vajpayee as a moderate, the only one, perhaps, in his Hindu nationalist party.
The next claimants are the National Front-Left Front. The NF-LF is expected to win 145 seats, but a spokesman, Jaipal Reddy, said many independent MPs and smaller regional parties will rally behind the left-wingers to keep out the Hindu right. The BJP's call to revive Hinduism's ancient caste hierarchy scares not only Muslims but also lower-caste Hindus. "We can count on upwards of 200 seats," said Mr Reddy.
The NF-LF is a wobbly pudding of Marxists, socialists, lower-caste leaders and regional potentates whose second obstacle - after finding the 270 MPs for a majority - is to select a suitable prime minister. A former prime minister, Vishwanath Pratap Singh, would be the likeliest choice, but he is playing coy. Another front-runner is Jyoti Basu, 80, a London School of Economics graduate who has kept West Bengal state under Marxist rule for 19 years.
A third option is Laloo Prasad Yadav, the chief minister of Bihar. Mr Yadav is a populist under whose rule Bihar has lapsed into the country's most wretched and lawless state.
While the Hindu revivalists and the left-wingers fight it out, the Congress party has sunk into a pit of acrimony. Some veterans hold Mr Rao responsible for the party's election rout and want him to go. But Mr Rao's dwindling supporters caution that if he is toppled, the party could be wracked by a war of succession that would leave it even more splintered.
The ultimate decision on whether Mr Rao stays or is chased out may depend on the late Rajiv Gandhi's widow, Sonia. Senior Congress leaders yesterday sought Mrs Gandhi's blessing to have Mr Rao replaced as party chief, but her response is not yet known.Reuse content