27 dead in wave of militant attacks