A hospital had to be evacuated as the earthquake made buildings crumble and collapse.