The protest, by some accounts, was for the most part not violent. The violence that did happen was a planned and targeted action perpetrated by a highly trained militia exploiting the cover of the protests.
Reinforcements were delayed intentionally, and the second attack clearly accounted for the contingency of a saferoom escape by smoking them out. Indeed, several hours before the attack occurred, it's possible that the area was being scoped out, and pictures taken.
Furthermore, the group that is apparently responsible has been identified, and is being pursued.
If you want to know more, the middle-eastern thread at SomethingAwful is tracking developments.