India's president has invited Manmohan Singh to lead the country's next government after days of uncertainty.
Singh, with Sonia Gandhi, holds up the invitation to form a government
Mr Singh, the architect of the country's economic reforms, will become India's first Sikh prime minister.
Congress MPs picked the former finance minister to be India's next leader after Sonia Gandhi's shock rejection of the post on Tuesday.
Mrs Gandhi says she will continue to head the Congress party. No date has yet been agreed for a swearing-in.
After his meeting with President APJ Kalam, Mr Singh said he humbly accepted the job, although the people's mandate had been for Mrs Gandhi.
He said he would make India a model of economic reforms that make "opportunities available to the poor".
"The 21st century should be the Indian century," he told reporters outside the presidential palace.
A relaxed Mrs Gandhi said she had been under tremendous pressure in the past 48 hours.
"The country will be safe in Manmohan Singh's hands," she said, as she stood alongside him.
Depth of feeling
Mrs Gandhi had earlier rejected emotional appeals from Congress MPs and supporters to change her mind and accept the premiership.
In a statement to her party workers, she said she would continue to head the party and remain in politics.
"Congress is better and I want Sonia to be PM"
Indians split on Sonia decision
"But I appeal to you to understand the depth of my sentiment when I say I cannot reverse my decision," she said.
She then nominated Mr Singh for the post of prime minister at a meeting of party MPs - a move they accepted.
"I have always admired his qualities of head and heart. I urge you all to give him your unstinted support," she said.
Manmohan Singh said he would do his "utmost to live up to the great trust reposed" in him and paid tribute to Mrs Gandhi.
"The example of sacrifice set by Sonia Gandhi is in keeping with the highest standards of idealism that was generated during the freedom struggle," he said.
On the streets, the response to Mr Singh's appointment reflected the respect held for the experienced politician.
In Punjab, Sikh voter Harbhajan Singh Puri, a retired engineer, said: "Manmohan is a brilliant man... with unfaltering integrity and honesty. Sonia Gandhi will not regret her decision."
India's top two posts are now held by men from religious minorities - Mr Kalam is a Muslim.
Mrs Gandhi and her close aides had met alliance partners throughout Wednesday morning, all of whom said they would support her choice for the post.
Earlier in the day, senior Congress members had resigned from their party posts to put pressure on Mrs Gandhi to rethink her decision.
Riot police were deployed in the sweltering heat outside Mrs Gandhi's Delhi residence which was under siege from Congress party supporters.
When news filtered through to them of the Congress party efforts to make Mrs Gandhi change her mind, they burst into cheers of "Bring back Sonia Gandhi".
But Mrs Gandhi proved to be unwavering in her decision.
In a boost to the Congress-led coalition, the DMK party in the southern state of Tamil Nadu said it would join the government, after earlier saying it would only support it from outside.
"We understand the reasons behind her decision and we will accept her choice," DMK party president M Karunanidhi said.
Stock markets - which fell dramatically on news of the surprise electoral defeat of the pro-market BJP party - rallied for the second successive day.
The Congress party gained a surprise victory in the country's recent election, but it does not command an overall parliamentary majority.