A Spanish museum has decided to display a controversial sculpture depicting the country's former monarch, Juan Carlos, being sodomized.

Bartomeu Mari, the director of the Barcelona Museum of Contemporary Art (MACBA), backtracked on a previous decision to cancel the entire exhibition The Beast and The Sovereign over the presence, among various artworks, of a papier mache statuette named Not Dressed for Conquering/Haute Couture 04 Transport.

The piece by Austrian artist Ines Doujak depicts Juan Carlos, who held the Spanish throne for 39 years before abdicating in favour of his son, King Felipe VI, naked and on all fours as he is sodomized by late Bolivian labour leader and feminist icon Domitila Barrios, who is in turn sodomized by a dog.

The sexual scene is set on a bed of Nazi helmets, on which the former King seems to be vomiting a bluebottle bouquet.

Mari had initially asked the curators of the exhibition to pull the piece. The request was, however, turned down amid accusations of censorship, with the organisers demanding MACBA displays all artworks or cancels the whole exhibition.

At first Mari seemed to opt for the latter only to make a last minute U-turn one day before the exhibition's opening.

The director explained his decision in an open letter, also offering his resignation.

"The opinions expressed by many different sectors of society, from the world of art and culture to politics and the media, as well as international art professionals have made me reconsider the original decision not to inaugurate," Mari wrote, AFP reported.

The director admitted that his intention of protecting MACBA's reputation as a "cultural institution dedicated to public service" had backfired.

The controversial statue is part of a series of works by Doujak that according to her website aim to shed light "on the highly complex and asymmetrical relationships between Europe and Latin America", touching on the issues of colonialism and exploitation.

Juan Carlos, 77, surprisingly announced he was to step down in June last year. His popularity with the Spanish public had dipped at the time, following a series of royal scandals, including an elephant-shooting trip he took in the middle of Spain's financial crisis.