The chedi was built in 555, or 757 according to some sources, at nearly the exact center of the original walled city. It wasn't unusual for large monumental pagodas to be built by themselves back then. The structure was originally smaller and in the squarish style of the Srivijaya empire. It is said to contain relics of the Buddha bought from Sri Lanka two thousand years ago. The chedi was enlarged and given its current 'Sri Lankan' shape around 1227, which is probably also when a temple was built around the pagoda.
The chedi sits in a large cloister-like courtyard filled with a forest of 158 smaller pagodas. The smaller monuments are in a variety of styles and appear to be funerary reliquaries built by the faithful over many hundreds of years.