Seven people were arrested and accused of being gay and promoting homosexuality in Egypt even though there is no law banning the practices.
The move comes after the rainbow flag of the LGBT movement was allegedly raised at a concert last week in a rare sign of support for gays in the conservative country.
It took place at a Cairo performance on Friday by popular Lebanese indie rock band Mashrou' Leila, a jazzy, electro-Arabesque group whose lead singer is openly gay.
The seven were arrested on Monday and charged with "inciting immorality", security officials said, adding that state prosecutors acted after authorities discovered the seven had "raised the flag of homosexuals".
Homosexuality is highly taboo in Egypt among both majority Muslims and the Christian minority, but not explicitly prohibited by law.
In practice, however, the state regularly seeks to prosecute individuals under alternative charges, including "immorality" and "debauchery", which are normally reserved for prostitution.
Prosecutors also sometimes charge gay people with "blasphemy", which is also considered a crime in a country with severe limits on free speech.
Cairo! <3 pic.twitter.com/yDdMay4mPR— Mashrou' Leila (@mashrou3leila) September 23, 2017
Shortly after the concert, images and videos of the flag-raising went viral, with some praising the move but others posting virulent attacks on social media.
An exasperated host on one television channel urged Reza Ragab, the deputy head of the official musicians' union, to explain how such a thing could have happened "on Egyptian soil".
"We are against gay art," Mr Ragab said in a phone interview on AlAssema TV.
"It is depraved art."
He said the band had all the necessary permits, including approval by the state security services, but added that the union would ban the group from further performances.
Mashrou' Leila has played in Egypt before, although the group was twice banned from performing in Jordan over allegations its musicians violate the kingdom's traditions and commit blasphemy.
It is one of the Arab world's few rock acts to gain significant resonance in the West, playing its Arabic-language fusion to a growing number of fans in Europe and the United States.
The band on its Facebook page called the Cairo show, held in a shopping centre in a well-heeled suburb, one of the best they had ever played, and said it had been an "honour to play to such a wonderful crowd".
The feed became a culture war battle zone in subsequent posts, however, with some users hurling insults while others defended the group.
Egypt regularly arrests gay men, with large police raids on parties or other locations such as bath houses occasionally creating media sensations.
The most famous raid was in 2001, when 52 men were arrested at a dance party on a floating nightclub moored on the Nile called the Queen Boat.
The men were put on trial in a highly publicised proceeding during which they were mocked in the media, which published photos of them as well as names and addresses.
Almost half were sentenced to prison after a trial that was widely criticised by human rights groups and Western governments.