The leaders of India's Congress party last night thanked the people for returning them to power with a "massive mandate".
Congress president Sonia Gandhi said they had made the "right choice" and prime minister Manmohan Singh vowed the party would "rise to the occasion".
Earlier the main opposition Bharatiya Janata Party (BJP) and the Third Front conceded they had lost.
State television said the Congress's alliance was ahead in 260 seats, compared with the BJP's 161, the Third Front (58) and others (64).
Congress should now find it easier to form a stable government. "I express my deep sense of gratitude to the people for giving us this massive mandate, for having reposed their faith in the party," Singh said.
"The people of India know what's good for them and have made the right choice," said Gandhi.
Earlier Rajnath Singh, president of the Hindu-nationalist BJP, said it had not expected this kind of result. "We will sit together later today, once all the results are out, and analyse what happened," he said.
Senior BJP official Arun Jaitley said: "Something certainly did go wrong... Our performance was not up to expectation." Prakash Karat, the leader of the Communist Party of India (Marxist), the key mover in the Third Front, accepted Congress had won.
"The [communists] and the left parties have suffered a major setback," he said.
Several days of backroom deals still lie ahead but the prospect of a very weak and unstable government has receded.
There were earlier reports that home minister P Chidambaram had lost his seat in Tamil Nadu, but a recount is under way.
Counting began at 8am local time (2.30am GMT) and with electronic voting machines being used the first trends were quickly available.
Congress confounded predictions, particularly in Uttar Pradesh, Kerala, Andhra Pradesh and Gujarat.
Left-wing parties appear to be suffering major reverses in West Bengal and Kerala and the party of Dalit leader Mayawati, also in the Third Front, underperformed in Uttar Pradesh.
Senior leftist leader Sitaram Yechury said: "It's the people's verdict."
One high-profile winner was former UN diplomat Shashi Tharoor for Congress in Kerala's capital, Trivandrum.
Since polling ended on Wednesday, the two main parties have been involved in a series of political meetings, scrambling to gain pledges of support in a predicted hung parliament.
The main thrust of the Congress manifesto has been on economic recovery and boosting growth, while the BJP focused on easing taxation and recovering money illegally stashed abroad.
Security was tight in a number of areas ahead of the results announcement. Meetings of five or more people were banned across Rajasthan and victory processions barred in Uttar Pradesh.
Turnout for the election has been put at about 60%, compared with 58% in 2004.
Security has so far generally been considered a success, although about 60 people lost their lives, mostly in Maoist violence.
India's new 543-seat parliament, with a new government in place, is supposed to sit by 2 June.
INDIAN ELECTION AT A GLANCE
Eligible voters: 714m
Polling centres: 828,804
Voting days: 16, 23, 30 April;
7, 13 May