President Barack Obama, flanked by his smiling wife Michelle and their daughters Malia and Sasha, strode to a lectern at his campaign headquarters in Chicago, Illinois to the upbeat strains of Stevie Wonder's song, Signed, Sealed, Delivered, I'm Yours.

Looking visibly relieved after many long weeks of hard campaigning, the president looked on as the chant "Four more years, four more years!" resounded across the room.

His victory speech lasted for almost 25 minutes, but one message underlined his every word: "The best is yet to come, but we have more work to do.

"Thanking the thousands of supporters in the room, he told them: "Tonight, more than 200 years after a former colony won the right to determine its own destiny, the task of perfecting our union moves forward.

"It moves forward because of you, it moves forward because you reaffirmed the spirit that has triumphed over war and oppression, the spirit that has lifted this country from the depths of despair to the great heights of hope, the belief that while each of us will pursue our own individual dreams, we are an American family and we rise or fall together as one nation and as one people.

"Tonight, in this election, you, the American people, reminded us that while our road has been hard, while our journey has been long, we have picked ourselves up, we have fought our way back, and we know in our hearts that for the United States of America, the best is yet to come."

The president thanked every campaigner and voter - acknowledging with a wry smile the patience of those who had waited in lengthy queues to register their preference - telling them whether they were Obama or Romney voters, they had made a difference.

Obama said he had congratulated Romney and his running mate Paul Ryan on what he called a "hard-fought campaign", saying that they had battled each other fiercely because they cared so much about the future of their country.

The president applauded the Romney family, including Mitt Romney's father George, a former governor of Michigan, and his mother Lenore, once a Senate candidate herself, saying the family had "chosen to give back to America through public service", a legacy that he said should be honoured.

He said he looked forward to sitting down with Romney in the weeks ahead to discuss where they can work together to move the country forward.

Obama also thanked Joe Biden, calling him "America's happy warrior, the best vice-president anybody could ever hope for", before paying tribute to his wife Michelle, saying "I wouldn't be the man I am today without the woman who agreed to marry me 20 years ago."

He said: "Let me say this publicly, Michelle - I have never loved you more. I have never been prouder to watch the rest of America fall in love with you too as our nation's first lady."

In another personal touch the president spoke warmly of his two daughters, Sasha and Malia, telling them he was so proud of them but that "for now, one dog is probably enough".

Obama called his campaign team and volunteers "the best in the history of politics", drawing huge applause from the crowd, and sealed their lifelong support by telling them they were all family.

He said: "No matter what you do or where you go from here, you will carry the memory of the history we made together, and you will have the lifelong appreciation of a grateful president.

"Thank you for believing all the way."

Obama told the audience that politics had a significant role in society, saying: "Democracy in a nation of 300 million can be noisy and messy and complicated.

"We have our own opinions, each of us has deeply held beliefs, and when we go through tough times, when we make big decisions as a country, it necessarily stirs passions, stirs up controversy.

"That won't change after tonight and it shouldn't. These arguments we have are a mark of our liberty. We can never forget that as we speak, people in distant nations are risking their lives right now just for a chance to argue about the issues that matter, the chance to cast their ballots like we did today.

"But despite all our differences, most of us share certain hopes for America's future."

The president spoke of a shared desire to see children have the best education opportunities, for America to live up to its legacy as a global leader in technology and innovation, and for it to be a country that is not burdened by debt, weakened by inequality or threatened by the destructive power of a warming planet.

He said Americans want to pass on a country that is safe, respected and admired around the world, defended by the strongest military and best troops on Earth.

Obama said he wanted America to move with confidence beyond "this time of war" to shape "a peace that is built on the promise of freedom and dignity for every human being".

He spoke of a "generous, compassionate and tolerant" America that is "open to the dreams of an immigrant's daughter who studies in our schools and pledges to our flag", and painted a vision of a future that would let "a young boy from the south side of Chicago who sees a life beyond the nearest street corner" and others who want to be doctors, entrepreneurs or diplomats fulfil their dreams.