BAIDOA, Somalia — Hundreds of people rioted Friday near the headquarters of Somalia's virtually powerless government after a Cabinet minister was fatally shot outside a mosque.

People began streaming into the streets and setting fires just hours after the killing of Abdallah Isaaq Deerow, Somalia's minister for constitutional and federal affairs.

An unidentified gunman shot Deerow, then escaped, according to an Associated Press reporter at the scene.

The shooting was the second this week of a lawmaker in Baidoa, the only town controlled by the fragile administration. Mohammed Ibrahim Mohammed, chairman of the parliamentary committee for constitutional affairs, was wounded Wednesday night. Police were investigating both shootings.

The government, which has no military, has watched helplessly in recent months as Islamic militants took over much of the country. On Thursday, 18 top ministers resigned, saying the government has failed to bring peace to this chaotic African nation.

Deerow was not among those who resigned.