The ruins of Bagan cover an area of 16 square miles. The majority of its buildings were built in the 1000s to 1200s, during the time Bagan was the capital of the First Burmese Empire. It was not until King Pyinbya moved the capital to Bagan in AD 874 that it became a major city. However, in Burmese tradition, the capital shifted with each reign, and thus Bagan was once again abandoned until the reign of Anawrahta. In 1057, King Anawrahta conquered the Mon capital of Thaton, and brought back the Tripitaka Pali scriptures, Buddhist monks and craftsmen and all of these were made good use of in order to transform Bagan into a religious and cultural centre. With the help of a monk from Lower Burma, Anawrahta made Theravada Buddhism a kind of state religion, and the king also established contacts with Sri Lanka. In the 12th and 13th centuries, Bagan became a truly cosmopolitan centre of Buddhist studies, attracting monks and students from as far as India, Sri Lanka as well as the Thai and Khmer kingdoms. In 1287, the kingdom fell to the Mongols, after refusing to pay tribute to Kublai Khan. Abandoned by the Burmese king and perhaps sacked by the Mongols, the city declined as a political centre, but continued to florish as a place of Buddhist scholarship.