India's opposition Congress party has swept to a surprise victory in the country's general elections.
Sonia Gandhi and Mr Vajpayee - about to change roles?
Congress leader, Italian-born Sonia Gandhi, has yet to confirm she will be India's next prime minister.
Her party finished well ahead of the governing BJP-led alliance of Prime Minister Atal Behari Vajpayee who resigned as early results came in.
He called the elections early amid an economic boom and Pakistan peace moves but failed to impress poorer voters.
The BBC's Adam Mynott in Delhi says it is the huge unspoken mass of Indians, largely ignored by the BJP and who have no electricity, poor sanitation and filthy water who have spoken.
In an address on national television Mr Vajpayee said he accepted the verdict and said it was a demonstration of India's strong democractic roots.
"My party and alliance may have lost but India has won," he said.
He has been asked to continue until a new prime minister is sworn in.
Sonia Gandhi emerged to speak to journalists as the scale of her victory was becoming clear.
"Over the next few days the process of government formation will gather momentum," Mrs Gandhi said in Delhi.
She promised her Congress Party would take the lead in forming a stable government.
And she said it would be up to Congress members of parliament to decide who would be the next prime minister.
She is expected to begin consulting her allies and smaller parties over the next two days, to try and form a government.
Mrs Gandhi also said Congress would continue the ongoing peace process with Pakistan, which began in January.
"From the very beginning we have been supporting Prime Minister Vajpayee's initiative vis-a-vis Pakistan," she said.
In its first reaction, Pakistan said it hoped the peace process between the two countries would continue.
"The desire for peace is not linked to individuals," Information Minister Sheikh Rashid told AFP.
Mr Vajpayee called the poll six months early hoping to cash in on the peace initiative as well as an economic boom - but all the signs are that the move has backfired.
Nearly 380 million people voted in elections held over three weeks.
Mr Vajpayee held a last meeting of his cabinet before driving to the presidential palace to submit his resignation to President Abdul Kalam.
The cabinet passed a resolution praising Mr Vajpayee's leadership.
"With him as our helmsman, the country made great progress in all spheres of national endeavour," it said.
At 79, most observers believe it is the end of Mr Vajpayee's political career, which has lasted over six decades.
"It is for you and history to judge what we have achieved in this period," he said in his final address as India's leader.
Sonia Gandhi is relatively inexperienced politically, something which has been held against her by her opponents along with her foreign birth.
But Congress' campaign was energised by the entry of her son Rahul, the fourth generation of the Nehru-Gandhi dynasty to join politics.
He won by over 100,000 votes in the constituency of Amethi in north India, a seat once held by his father, former Prime Minister Rajiv Gandhi.
COUNTING THE VOTES
543 constituencies in 28 states
About 675m registered voters
One million voting machines
Turnout across four phases was about 56%
Main contest between BJP and Congress alliances
Repolling ordered in four constituencies
As news of Congress's stunning win began filtering in, party supporters took to the streets of Delhi, dancing with joy and setting off firecrackers, as soon as the first results came in.
"We feel vindicated," Congress spokesperson Ambika Soni told BBC News Online.
"This result show that this party is for the common man."
Congress' surprise showing has been made possible by huge wins in the key southern states of Andhra Pradesh and Tamil Nadu, where it won the bulk of the seats along with its allies.
In another upset, Congress has won 12 out of 26 seats in Gujarat, a state rocked by anti-Muslim violence two years ago.
The BJP, whose state administration was blamed for doing little to prevent the violence, was expected to do very well there.
Communist parties, expected to back a Congress-led Government, have also recorded their best-ever performance with huge victories in Kerala and West Bengal.
Only 539 of the 545 seats in the lower house, or Lok Sabha, are being counted on Thursday.
Repolling has been ordered in three seats in the eastern state of Bihar because of irregularities and in one seat in Manipur because of a landslide. Two seats are appointed by the president.