Gordon Brown congratulated Barack Obama on his election this morning and said they would work together to get Britain and the US out of the economic downturn.
"I have just sent my warmest congratulations to Senator Obama on his election as president of the United States of America and I have also sent my best wishes to Michelle and his family," the Prime Minister said.
"This is a moment that will live in history as long as history books are written."
Speaking from No 10, Mr Brown said: "I have talked to Senator Obama on many occasions and I know that he is a true friend of Britain.
"I know that the values we share in common and the policies we work on together will enable us, these two countries, to come through these difficult economic times and build a safer and more secure society for the future."
Mr Brown, who had refused to single out any candidate for endorsement in the presidential contest, said Mr Obama shared his desire to "bring the world together".
"I think people in difficult times are looking for the best progressive policies to take us through these difficult times," the Premier said.
"I think what we and Senator Obama and his policies have in common is that we want to help hard-working families through this difficult economic time.
"We want to stabilise the financial system for the future and we want all countries to work together as Senator Obama wants to do, so that we can make for a better future, not just for our countries but for the rest of the world.
"I believe that Senator Obama and I share those views and, as president-elect and then president, I'm looking forward to working very closely with him."
He added: "I hope to be able to work with Senator Obama to bring the world together so that we can face these difficult times with more coordination and more unity than we've seen before."
The Prime Minister said they would be working together over the next "months and years" not only to deliver strong economies for the future but also to tackle international challenges such as the Middle East.
"Without a solution to them, we will have instability in the rest of the world," he said.
"I believe the strong, historic relationships between Britain and America, as I believe Senator Obama acknowledges, are built not just on history and tradition, they are built on values.
"Values of liberty and opportunity, values that he mentioned today, values that we hold in common."
Mr Brown also sent a message to John McCain this morning.
"He has shown characteristic dignity in defeat, the same dignity which marked a lifetime of service to the public," Mr Brown said.
The Conservative leader David Cameron said Mr Obama was the first of a new generation of world leaders.
"In electing Barack Obama, America has made history and proved to the world that it is a nation eager for change," he said.
"This has been an exciting and inspirational contest with two great candidates.
"In these difficult times people everywhere are crying out for change. Barack Obama is the first of a new generation of leaders who will deliver it - he has my whole-hearted congratulations.
"This is an important moment not just for America but for the world.
"Barack Obama's victory will give people a new opportunity to look at the United States and see her for what I believe she is - a beacon of opportunity, freedom and democracy."
In America President George Bush phoned Mr Obama to congratulate him on winning the presidency.
He told him: "What an awesome night for you, your family and your supporters."
He added: "You are about to go on one of the great journeys of life. Congratulations and go enjoy yourself."
Liberal Democrat leader Nick Clegg congratulated Barack Obama and welcomed the result.
Mr Clegg said: "British voters may not have been able to vote in this election, but its outcome is vital to our future.
"Climate change, the global economy, and threats to our collective security now demand a radical new approach by Barack Obama, leaving the Bush era firmly behind.
"The world will not succeed in this era of globalisation without the leadership of the new American President.
"The weight of peoples' hopes and expectations on Barack Obama is immense."Reuse content