Barack Obama has been re-elected as US president

Barack Obama has been re-elected as US president.

The Democrat secured a second term in the White House after wins in crucial swing states following one of the closest run election races in history.

Obama thanked supporters on Twitter, saying: "We're all in this together. That's how we campaigned."

His rival Mitt Romney, a former Massachusetts governor, pushed the result to the wire, taking Indiana from his rival and appearing to lead in the popular vote.

But key battlegrounds, including Ohio and New Hampshire, were called for President Obama taking him over the 270 electoral college barrier needed for victory, according to media projections.

The president had spent the day playing basketball in a gym near his home on Chicago's south side and told reporters he was "confident we've got the votes to win".

The projected win, which came through at 4.19am UK time, brought scenes of jubilation at Obama's campaign headquarters in Chicago.

Voter turnout was reported to be high, with long queues at some polling stations following the most expensive presidential battle in US history at a cost of £1.3 billion