Israel's gay community braved vehement opposition from religious fundamentalists and held a large happening in Jerusalem on Friday, complete with live rock music, dancing and declarations of pride.

The event — originally planned as a march through the city — was held behind fences at a university sports stadium on the Holy City's outskirts after organizers bowed to police fears of violent protests by ultra-Orthodox Jews.

Nearly 4,000 revelers flocked to the stadium, about the same number as attended last year's gay pride march in the city, where Jewish, Muslim and Christian opposition to the events runs high.

Participants were mainly dressed in regular street clothes — making it a far more staid affair than gay pride events in the more permissive city of Tel Aviv — although one bearded man sported the black hat and jacket usually worn by ultra-Orthodox men, but with a magenta-colored taffeta skirt and candy-striped tights.

Police said 3,000 officers were deployed to secure the rally. Five protesters, some of them armed with knives and batons, were arrested during a brief scuffle with a small group of gay activists who tried to march along the planned route, said police spokesman Micky Rosenfeld. Another was arrested after calling out homophobic slurs in the stadium, he said.

Click here to go to FOXNews.com's

Last year's march was marred by bloodshed when an ultra-Orthodox man stabbed and wounded three participants.

Over the past week, hundreds of ultra-Orthodox Jews battled police and torched vehicles and trash bins in the streets to protest the planned march, and threatened further violence if the parade went ahead.

Police security worries spiraled after an errant Israeli artillery shells killed 19 civilians in Gaza on Wednesday and Palestinian militants vowed to carry out suicide bombings in Israel in retaliation.

Responding to those concerns, gay pride organizers agreed to turn the parade into a rally, held inside the fenced-in stadium of Jerusalem's Hebrew University, which was ringed by mounted police and anti-riot units.

Gay demonstrators' numbers were bolstered by heterosexual supporters, some in protest of the ultra-Orthodox pressure to cancel the event and others just enjoying the carnival atmosphere in bright autumn sunshine.

"I'm not gay, but I came to show solidarity, to support freedom of expression and to party," said one 17-year-old girl who did not want to be named because she had skipped school to attend.

Several men and women wore T-shirts emblazoned with the slogan "Straight and proud".

Israeli rock and rap band Dag Nahash played onstage while people danced on the running track. Others, some pushing infants in strollers or walking their dogs, bought hot-dogs and beer and browsed the stalls for belts and wristbands embroidered in the rainbow colors of the gay movement.

Representatives of a leading condom manufacturer handed out free samples and civil rights groups distributed leaflets and T-shirts.

The parade dispute has become a flashpoint in the battle for gay rights in Israel, highlighting differences not only between secular liberals and religious conservatives but also within the Jewish religious community.

Rabbi Yosef Elnikaveh, a prominent orthodox Jewish leader, has called homosexuality a "mental illness," while others have described it as "an abomination."

At the stadium Friday, a group of observant Jews from the Reform and Conservative streams of Judaism held placards pleading for peaceful coexistence.

"We want to pass on a message of tolerance and rejection of violence," said one of them, Gershon Bar-Yaakov.

Some religious leaders proposed holding the event in Tel Aviv, but in an interview published Friday in the Haaretz daily, Orthodox Jewish Lesbian Avigail Sperber said that to move the venue would be to miss the point.

"Despite the caustic reactions, the religious community is finally talking about the subject and is beginning to realize it has homosexual and lesbian members," she said. "It's more important to hold a gay pride parade in Jerusalem than in Tel Aviv because being gay in Tel Aviv is not much of a problem."

Addressing Friday's rally, Elena Canetti of the Jerusalem Open House, the gay rights group behind the event, answered accusations that holding it was an unnecessary provocation.

"As a lesbian, as a woman, as a Jew and simply as a human being, I have the right to live my life as a lesbian in Jerusalem, openly in my city, close to my family, my friends, my neighbors and my workmates," she said. "If we flee to another city, Tel Aviv, Amsterdam or San Francisco, we shall find ourselves centimeter by centimeter giving way to bullies and violence."