RIO DE JANEIRO (AP) — Gay rights activists in Brazil are using the spotlight of the World Cup to draw attention to the harsh penalties gay people face in many of the countries represented at soccer's premier event.

This week's first-round featured a match between Iran, whose former president claimed gays don't exist, and Nigeria, where the penalty for gay sex ranges from imprisonment to death by stoning. At a city square near the match in Curitaba, a protest led by the gay rights organization Grupo Dignidade attracted about 400 people, many brandishing signs reading "Show homophobia the red card," and "In this World Cup, homophobia is out of bounds."

Activists also are pointing out that Brazil, itself, is not entirely gay-friendly. Rio de Janeiro and Sao Paulo long have hosted some of the biggest and best-known gay pride parades in South America, and the country was the second in the continent to legalize gay marriage, but outside of major cities, being gay continues to be a fraught existence.

Last year in Brazil, there were 313 anti-gay killings, according to the watchdog organization Grupo Gay da Bahia. In 2012, nearly 10,000 anti-gay human rights violations were reported, according to a Brazilian government review.

"We have made great strides here in Brazil," said Grupo Dignidade leader Toni Reis. "But we still have a long way to go."

Reis said gay activists who attended Monday's Iran-Nigeria match were well-received by fans of those two countries and that several Iran supporters who saw the nearby protest expressed their support for its message.

"We're not against the Cup and we're not against the players or the fans," Reis said in a telephone interview. "Our objective was to make a strong statement against homophobia around the world."

Other World Cup nations, too, have come under criticism for their policies on homosexuality. Russia, which is hosting the 2018 World Cup, touched off an international furor last year over legislation prohibiting "propaganda of nontraditional sexual relations among minors." Next week, Russia will face Algeria, where homosexuality is illegal and punishable by imprisonment.

"Homosexuality was considered a mortal crime in Brazil and then as a sickness," Reis said. "Traces of that remain, but Brazilian society has come a long way.

"We could be a model for countries like Iran and Nigeria."