Madrid's city hall has apologised after distributing videos featuring a white actor wearing blackface as part of wildly popular Epiphany festivities.
One of the videos also had the man in blackface speaking in a heavy accent - leading to accusations of racism.
Madrid's deputy mayor apologised for the "regrettable mistake", blaming the company which produced the videos.
Blackface was a historical practice in which black people were mocked for the entertainment of white people.
The 6 January Christian feast day of Epiphany, when observers celebrate the visit to Jesus by the Magi - commonly known as the Three Kings, or Wise Men - is widely celebrated in Spain.
Children polish their shoes on the eve of the event known as "El Dia de los Reyes" (the Day of the Kings) and leave them ready for the Three Kings - Melchior, Caspar and Balthazar - to put their presents in.
For many Spaniards the day is as significant as Christmas.
The annual Three Kings parades, held on 5 January, are a much-loved feature of Spanish Christmas celebrations.
Ahead of this year's event, Madrid City Hall hired a firm to produce personalised video messages from the kings for the children in the Spanish capital.
Between 20 and 30 such video messages were sent out, the deputy mayor said.
Anti-racism group Afrofeminas condemned the videos as "unforgivable and irresponsible".
Blackface is a historical practice that dates back around 200 years. It is seen as racist and many people find it deeply offensive.
It commonly refers to when someone - typically with white skin - paints their face darker to resemble a black person.
Several politicians and media figures, as well as Canadian Prime Minister Justin Trudeau, have been embroiled in blackface scandals in the past few years.