History of Qufu
During the Shang, the area around Qufu was home to the people of Yan, who were counted by the Chinese among the “Eastern Barbarians” or Dongyi. Along with Pugu (around Binzhou) and Xu (along the Huai River), Yan joined the Shang prince Wu Geng and the Three Guards in their failed rebellion against the Duke of Zhou c. 1042 bc. After the rebels’ defeat, the Duke launched punitive campaigns against the Dongyi, forcing their submission and placing their territory under loyal nobles. The territory of the Yan became part of the state of Lu, who made Qufu their capital throughout the Spring and Autumn period. This city had walls considerably larger than the present Ming-era fortifications, including more land to the east and north.
During the Tang Dynasty and the early days of the Song Dynasty the city was centered around the present-day Temple of Duke Zhou, at the northeastern corner of today’s walled city. At 1012, Qufu was renamed to Xianyuan County, and relocated to the new site, some 4 km (2.5 mi) east of today’s walled city, next to the supposed birthplace of the legendary Yellow Emperor and the tomb of his son Shaohao. A temple in honor of the Yellow Emperor was built there; all that remains today are two giant stelae (the Shou Qiu site).
After the conquest of the northern China by the Jurchens, the new Jin Dynasty renamed Xianyuan back to Qufu (in 1142), but the city stayed at its Song location. It was not until the reign of the Jiajing Emperor of the Ming Dynasty (1522) that the present-day city wall was built. The site of the city in 1012–1522 is now Jiuxian Village (旧县村).
During the Southern Song dynasty the descendant of Confucius at Qufu, the Duke Yansheng Kong Duanyou fled south with the Song Emperor to Quzhou in Zhejiang, while the newly established Jin dynasty (1115–1234) in the north appointed Kong Duanyou’s brother Kong Duancao who remained in Qufu as Duke Yansheng. From that time up until the Yuan dynasty, there were two Duke Yanshengs, one in the north in Qufu and the other in the south at Quzhou. An invitation to come back to Qufu was extended to the southern Duke Yansheng Kong Zhu by the Yuan dynasty Emperor Kublai Khan. The title was taken away from the southern branch after Kong Zhu rejected the invitation, so the northern branch of the family kept the title of Duke Yansheng. The southern branch still remained in Quzhou where they lived to this day. Confucius’s descendants in Quzhou alone number 30,000. The Hanlin Academy rank of Wujing boshi was awarded to the southern branch at Quzhou by a Ming Emperor while the northern branch at Qufu held the title Duke Yansheng. Kong Ruogu (孔若古), also known as Kong Chuan 47th generation was claimed to be the ancestor of the Southern branch after Kong Zhu died by Northern branch member Kong Guanghuang.
In 1948, Qufu played a minor role in the Yanzhou Campaign of the Chinese Civil War.
The artifacts of the historical sites at Qufu suffered extensive damage during the Cultural Revolution when about 200 staff members and students of Beijing Normal University led by Tan Houlan (谭厚兰, 1937–1982), one of the five most powerful student leaders of the Cultural Revolution, came to Qufu and destroyed more than 6000 artefacts in November 1966.
Source From: https://en.wikipedia.org/wiki/Qufu#History