President Donald Trump's late night tweet took many by surprise when he wrote "Tremendous success tonight. Thank you to all!"

His party had just lost control of the House of Representatives but he didn't seem to mind.

He hit the campaign trail hard over the last few weeks, sometimes doing two and three rallies a day. But the focus of his efforts was very much the Senate, perhaps knowing that the House was already a lost cause.

President Trump will be relieved that Republicans have not just held the Senate but actually increased their majority. He's also probably patting himself on the back because his campaign rallies produced results, helping Republican hopefuls to defeat vulnerable Democrats in red states.

He travelled to "Trump Country" and campaigned in a way that had all the hallmarks of his successful presidential run. 

Ignoring the advice of those around him to focus on the strong US economy, the president instead stoked fears over the approaching migrant caravan. He warned that the Democrats were weak on illegal immigration and border security. It seems to have worked.

But the Democrats are also celebrating victory. They needed to flip 23 Republican-held seats to win control of the House of Representatives and they exceeded that number.

House Minority leader Nancy Pelosi said they had won back the house for the people of the US and added that the victory would restore checks and balances over the Trump administration.

Democrats are likely to frustrate the president's legislative agenda and will now have the power to launch investigations into his administration, his election campaign and his business dealings.

Donald Trump could use this to his advantage when he runs for re-election in two years time. He may try to blame Democrats for causing a legislative log-jam.

Excessive oversight of the president could also backfire and rally the Trump base.

Today, both sides are claiming victory.

Perhaps the real winner won't be revealed until the next US election - the presidential race in 2020.