The back-to-back vehicle attacks in Barcelona and a nearby resort had been planned for a long time by an Islamic terrorist cell -- and could have been far deadlier had its base not been destroyed by an apparently accidental explosion this week, Spanish officials said Friday.