On either side of the temple axis there are two large buildings (the so-called "palaces"), of unknown function, each enclosing a square courtyard. These were built in the 11th or early 12th century.