Hundreds of buildings damaged in earthquake