The city was completely destroyed by an earthquake in 1797, but rebuilt a few years later 14 kilometers away from its original location (near a village named Cajabamba on the plains of San Antonio de Aguíscate).