A Brazilian Supreme Court has been forced to step in to referee a row over the sale of a comic book showing two gay Avengers characters kissing.

The 2010 Marvel publication was banned — and promptly unbanned — from an international book fair in Rio de Janeiro this month due to its "sexual content".

Avengers: The Children's Crusade follows superhero Wiccan, who is in a same-sex relationship with Hulkling (a character patterned on the Hulk).

Though their on-panel smooch has sparked an uproar in Brazil, it's not considered to be a major milestone in the comic book world.

In fact, Marvel first showed a kiss between two same-sex characters in 2001.

So how did we get here? And why is this particular comic causing such an uproar?

What happened?

The stoush started when Rio de Janeiro's conservative Mayor, Marcelo Crivella, stumbled across a copy of the comic book at the city's International Book Biennial last week.

Mr Crivella, a former evangelical pastor, swiftly took to Twitter to denounce the publication.

Loading

He ordered law-enforcement agents to raid the festival and seize all copies of the comic that included the kiss, saying he was acting to protect children against "sexual content".

"Books like this need to be packaged in black plastic and sealed," Mr Crivella said in a video posted on Twitter, according to a translation by the New York Times.

"This can't be induced, be it in schools, in a book, or wherever.

"We will always continue to defend the family."

According to Brazilian newspaper O Globo, the publicity actually led to retailers selling out of the comic book before agents could complete their search.

How did it get unbanned?

In response to the raid, organisers of the book fair filed a preventative injunction with the Rio de Janeiro Court of Justice.

They argued exhibitors should have the right to "commercialise literary works on the most diverse subjects".

Mr Crivella said the book should be packaged in black plastic and sealed. ( Reuters: Adriano Machado )

Federal Attorney-General Raquel Dodge also challenged the move by Mr Crivella.

She said allowing the Mayor to remove books was contrary to freedom of expression and the free exchange of ideas.

Though a lower court initially sided with Mr Crivella, Supreme Court Chief Justice Jose Dias Toffoli ruled in favour of Ms Dodge on Sunday, blocking the removal of any books.

Mr Crivella, who attracted criticism for labelling homosexuality a "terrible evil" in his 1999 book, Evangelizing Africa, said he would appeal against the decision.

Controversy not completely unexpected

Though many have pushed back against the raid, labelling it homophobic and in breach of the constitutional right to free expression, it is not completely unexpected.

Brazilian President Jair Bolsonaro, who previously labelled himself a "proud homophobe", rose to power last year promising to overturn years of liberal social policies, including more rights for same-sex couples.

Jair Bolsonaro previously labelled himself a "proud homophobe". ( Reuters/Ricardo Morae )

The far-right politician was outspoken in his criticism of a decision by the Brazilian Supreme Court to make homophobia a crime in June, and suggested it was time to appoint an evangelical Christian to the bench.

Just two months prior, he garnered headlines after warning the nation should not become known as a gay destination because "we have families".

However, he said tourists were more than welcome to "come here and have sex with a woman".

ABC/Wires