The 5.8-magnitude quake damaged buildings in Melbourne, but there were no immediate reports of serious injuries or deaths.