CAIRO — Egyptian authorities arrested seven people Monday who they accused of being gay and promoting homosexuality for allegedly raising the rainbow flag of the LGBT movement at a concert, filing charges even though there is no law officially banning the practice.

The flag was a rare sign of support for highly marginalized homosexuals in this conservative country and it came at a Cairo performance Friday by popular Lebanese indie rock band Mashrou’ Leila, a jazzy, electro-Arabesque group whose lead singer is openly gay.

The seven arrested Monday have been charged with “inciting immorality,” security officials said, adding that the Supreme State Security Prosecution acted after authorities discovered the seven had “raised the flag of homosexuals.” The officials spoke on condition of anonymity because they weren’t authorized to brief journalists.

Homosexuality is highly taboo in Egypt among both majority Muslims and the Christian minority, but it is 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 them with “blasphemy,” also considered a crime in a country with severe limits on free speech.

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,” 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 ubiquitous state security services, but added that the union would ban the group from further performances.

Mashrou’ Leila has played in Egypt before, although they have twice been 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 mall in an upscale suburb, one of the best they had ever played, and that it had been an “honor 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 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 publicized 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 criticized by human rights groups and Western governments.