The deadliest in recent times was a 6.3-magnitude quake which hit the southern city of Bam in December 2003 , killing 31,000 people -- about a quarter of its population -- and destroying the city 's ancient mud-built citadel .