Mr Singh said: "I express my deep sense of gratitude to the people for giving us this massive mandate, for having reposed their faith in the party."
He said that he would try to persuade Rahul Gandhi to join the cabinet.
Sonia Gandhi said: "The people of India know what's good for them and have made the right choice."
Earlier Rajnath Singh, president of the Hindu-nationalist Bharatiya Janata Party, told reporters 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.
BJP leader LK Advani has telephoned Mr Singh and Mrs Gandhi to offer his congratulations and the full support of his party to strengthen India, the BJP's Arun Jaitley said.
Prakash Karat, the leader of the Communist Party of India (Marxist), the key mover in the Third Front, accepted Congress had won.
"The CPM and the Left parties have suffered a major setback," he said.
The BBC's Chris Morris in Delhi says that a small crowd gathered early outside Congress headquarters to celebrate, banging drums and chanting slogans. There have been celebrations in Mumbai and elsewhere.
Our correspondent says 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 has now been ordered there.
Counting began at 0800 local time (0230 GMT) and with electronic voting machines being used the first trends were quickly available.
Indian Prime Minister Manmohan Singh thanks the voters
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, has 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.
The main BJP office in Delhi appeared deserted
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 BBC's Sanjoy Majumder in Delhi says there had been suggestions that both the Congress and BJP were losing relevance in India, ceding political space to smaller, local parties.
But this defeat for the BJP's LK Advani should certainly spell the end of his political career, he says.
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 has been tight in a number of areas ahead of the results announcement.
Meetings of five or more people have been 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.
This page is best viewed in an up-to-date web browser with style sheets (CSS) enabled. While you will be able to view the content of this page in your current browser, you will not be able to get the full visual experience. Please consider upgrading your browser software or enabling style sheets (CSS) if you are able to do so.