The attack on the barracks and detention centers raised fears of a breakdown of order amid a surge of coups in the region.