The competing warnings to the radio stations, a broader reflection of the prolonged struggle over who is in charge in Somalia, clearly touched a nerve of exasperation among the handful of independent journalists who have continued to work here despite many years of violence and threats.

“The order and counterorder are very destructive,” said Abukar Hassan Kadaf, the director of Somaliweyn radio, one of the broadcasters that could be affected. “Each group are issuing orders against us and we are the sole victims.”

Last Tuesday, at least 14 radio stations in Mogadishu halted music broadcasts, heeding a deadline issued 10 days earlier by Hizbul Islam, an insurgent group, which called music un-Islamic. The group warned of “serious consequences” to all who defied compliance.

Some broadcasters, forced to ad-lib the soundtracks on programming that had relied on music, resorted to the sounds of gunshots, roaring engines, car horns and animal braying as substitutes, at least while they devised more permanent solutions.

Angry at this new affront to its tenuous authority, the transitional government held a news conference here on Sunday to announce that any stations that had capitulated to the insurgent ultimatum would be punished with shutdowns.

Abdikafi Hilowle Osman, the general secretary of the Mogadishu administration of the Transitional Federal Government, told reporters that it considered the compliant broadcasters to “be working with the insurgents.”

He did not specify which of the stations would be closed or when.

The warning about music from Islamist insurgents is part of a broader assault on the influence of Western culture and ideology that they hope to purge from the country. Earlier the Shabab, the country’s most powerful insurgent group, which already controls some radio stations outside government-held areas, said it was banning BBC and Voice of America programming.

Last week the Shabab banned school bells in a Shabab-controlled town north of Mogadishu, decreeing that the noise was un-Islamic because it sounded like the ringing of church bells. The Shabab also banned the observance of all internationally recognized days like World AIDS Day.