A powerful and shallow earthquake struck Wednesday off Indonesia's Sumatra island, sending panicked residents rushing from their homes in a region hit hard by quakes and tsunamis in the past.