The Phra Mahathat Woramaha Wiharn temple with its huge chedi (pagoda) is one of the most important Buddhist temples in Thailand, and one of the very oldest. It is one of only six primary royal temples. The exact dates and order of construction are unclear, although it is known that the Phra Borom That Chedi at the center of the temple pre-dates the rest of the buildings by as much a six hundred years.
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.