The Scottish star of Four Weddings and a Funeral posted the rant at 11.44pm, over an hour after the exit polls correctly predicted a Conservative landslide victory.
Hannah, who is now playing Marvel character Holden Radcliffe in the new Agents of S.H.I.E.L.D movie, told his over 40,000 followers: "This whole Brexit cluster -f*** is really about 1 thing. Immigration ! Like it or not turns out weâ€™re a country of racists and Brexit/EU scepticism is the cover.
"Itâ€™s all about English nationalism . Shameful!"
Also known for his roles in The Mummy and Spartacus, Hannah describes himself in his Twitter bio as a Londoner, and a European.
The outraged tweet generated a huge response, with 6.6K retweets and 35.4K likes.
Five and a half thousand people commented on the post and while some said they held similar views not everyone agreed.
One user said: "Itâ€™s about saving this once great country, that gave you the acting career you are so good at, and have benefitted from hugely. Your welcome ðŸ˜³"
Another said: "Iâ€™m European, love Europeans & welcome immigrants for their cultural & economic benefit. I voted Brexit because the EU is inflexible, protectionist & undemocratic.
"We see again some remainers resorting to insults. Thankfully the majority have again voted for optimism & aspiration.
The tweet followed one from earlier in the night, directly after the exit poll was announced, in which he claimed a portion of the electorate who had voted for Prime Minister Boris Johnson would not benefit from his policies.
"So seems like weâ€™re totally f*****! It doesnâ€™t make it feel any better that most of the people who voted Bojo are going to be the one most f*****! Unless of course youâ€™re a hedge fund manager!" He wrote.
A number of users hailing from Hannah's home country said they hoped Scotland could avoid Brexit by becoming independent.
"Hope the Scots get out while they can. #indyref2020," said one user.
The Scottish National Party gained 48 seats in the 2019 general election. Leader Nicola Sturgeon has promised voters a second referendum despite Boris Johnson's saying he would block the move in his winning speech on Friday.