Built by Mehmet the Conqueror between 1462 and 1470 , the complex was almost completely destroyed by an earthquake in 1766 .
The complex was restored after the earthquake , a process that took 10 years .