The Ganjia Basin in Xiahe County, Gansu Province, China, is located on the northeastern edge of the Tibetan Plateau. The area lies in the transitional zone between the Plateau ethnic groups dominated by ancestral Tibetans, and the Central Plains dynasties dominated by ancestral Han in history. The Ganjia Basin is therefore well suited to studying the history of the intermixing of the Han and Tibetan peoples. In this study, we collected samples of organic materials from two ancient cities, Bajiaocheng (BJC) and Sirougucheng (SRGC), in the Ganjia Basin, which were used for radiocarbon dating. Our aims were to determine the construction times and function of the cities, based on the radiocarbon ages, Bayesian age modeling, and the analysis of relevant historical records. The results are used to discuss the role of the Ganjia Basin in the conflicts between and the integration of the two ethnic groups during the historical period. We conclude that BJC was established during 663-732 CE (Common Era); its early occupation history can be divided into an initial establishment phase (670-780 CE) and a phase of regeneration (880-1030 CE). SRGC was probably built at the time of the transition between the Song and Yuan dynasties (~1271 CE). Combining the dating results with an analysis of the architectural styles and historical records, we conclude that BJC was originally built by the Tubo Kingdom as a military stronghold, and its major functions were military, economic and religious, and to support the major eastward expansion of the Tubo. SRGC was most likely a temple-focused city intended to promote Tibetan Buddhism which was a major political and religious leadership for the Tibetans at that time, reflecting changes in the status of different religions in the Ganjia Basin. In addition, the intermixing and blending of the Han and Tibetan groups, reflected by the human activities in the Ganjia Basin, was an important demographic and cultural foundation for the formation of the culturally-diverse but spiritually-united modern Chinese people.