The manipulated image was posted by Víctor Ruiz, a spokesperson for the Socialists in the town of Calatayud on Tuesday, or the day before Spain celebrated its Three Kings celebrations when children in the country traditionally receive their Christmas presents.
It showed Prime Minister Mariano Rajoy in a coffin with his tongue hanging out and his eyes closed as if he were dead.
"And if we wake up tomorrow and receive this great present for Reyes (Three Kings)?" said Ruiz in his message accompanying the post.
— Esppeonza (@EsppeonzAguirre) January 7, 2015
Ruiz quickly withdrew the post, saying that it had been in "poor taste".
"It wasn't my intention to offend anyone, but I understand it might have been in bad taste, and once I realized this I removed the image after a few minutes," he wrote.
The austerity policies of conservative Popular Party government of Mariano Rajoy are deeply unpopular among many sections of the Spanish population. Cuts to the education and health sectors have seen hundreds of thousands of people take to the streets in recent years.
General elections are due in Spain at then end of 2015 or the beginning of 2015 with the Popular Party and the Socialists running neck and neck in the polls.
Frustration with the two major parties has also seen many people telling pollsters they will cast their ballot for the country's Podemos party, a left-wing grouping with its roots in Spain's 'indignado' or '15M' protest movement.
The group headed up by Pablo Iglesias has even topped several major newspaper polls.