Thousands of Brazilians who took to social media in support of a gay kiss have got what they wanted - two male soap opera characters, Felix and Niko, shared a historic kiss in prime time.

"Kiss him, Felix," urged thousands of viewers of Globo TV's popular soap Amor a Vida - but this was no ordinary television kiss. The campaign for it was partly led by a politician, and it took place online using Facebook and Twitter.

It's not unusual for Brazilian TV to feature gay characters, but two men kissing on screen is deemed so controversial that in 2005, a gay kiss was cut - at the last minute - from the final episode of another soap opera. This time, social media was a big part of the drama around Felix and Niko's on-screen kiss on Friday. As the relationship between the two men began to grow, so did the campaign on social media urging them to do it, using hashtags like "kiss him, Felix" (#beijafelix) and also "gay kiss" (#beijogay). Both had several thousand tweets in the lead-up to the kiss and after.

In addition, prominent personalities supported the campaign for the gay kiss - including Brazil's first openly gay MP Jean Wyllys, who helped start the hashtags and who has called the kiss "historic". "People gathered in front of the television in angst, and celebrated the kiss as if it was the World Cup," Wyllys told BBC Trending. It's unclear whether the campaigning actually influenced the plot. The script writer, Walcyr Carrasco, who is bisexual, says it was always planned, although other unconfirmed reports suggest two alternative endings were filmed (one which involved no kiss, and the other just a peck on the cheek).

The BBC Brasil Facebook page had more than 3,200 comments on the story - many of them welcomed the kiss, calling it "overdue" and a "taboo-breaker". But others were critical, saying the TV show would encourage children to be gay, or that it was against their religion. One congressman, Jair Bolsonaro, called the kiss "a milestone in society's perversion". Violent homophobic attacks are a problem in Brazil - six young men were recently arrested in Sao Paulo for alleged involvement in a string of attacks on suspected gays, including the murder of a 18-year-old.