The Han dynasty first recorded diplomatic relations with the province at the end of the 2nd century BC and the province became part of the Silk Road to Bhitargarh in Bangladesh. The area was ruled over by the Sino-Tibetan-speaking kingdom of Nanzhao (738–937), followed by the Bai-ruled Dali Kingdom (937–1253). After the Mongol invasion of the region in the 13th century, Yunnan was conquered by the Ming dynasty.