The president of the conservative Popular Party for the Canary Islands, Asier Antona Gomez, was also caught out when he uploaded a photograph of the television as the news broke.
Worried about the consequences of Brexit, he wrote a message with the photograph to promote political participation, in order to ensure Spain and other EU countries stay in the EU.
However, the politician failed to notice that he was also in the photo – in only his underpants.
Asier Antona (Presidente del PP Canario) publica una foto de una tele con el Brexit y él se refleja en calzoncillos pic.twitter.com/YvtAK6wt2z— El Brusko (@ElBrusko) 24 июня 2016 г.
After his photo gained attention for the wrong reasons, Gomez deleted the post.
He uploaded another photo the next day, this time with trousers.
"With trousers… Glad that such a tumultuous day did not make us lose our sense of humour," he wrote.
Spain's pro-austerity Popular Party, led by Prime Minister Mariano Rajoy, won the most seats in parliament in the general election held in December 2015, but failed to gain an outright majority.
Though Spain's leftwing parties gained more seats collectively, their failure to reach agreement on a coalition led to a second general election held on Sunday.
In that election the Popular Party again won the most seats, this time 137 of 350, but has fallen short of a majority. The Spanish Socialist Workers' Party was in second place, the leftwing Unidos Podemos alliance came third and the liberal Ciudadanos finished fourth.