Shandong is one of the birthplaces of Chinese civilization. The earliest hominin fossils found in Shandong, those of Yiyuan Man (沂源人), date to about 400,000–500,000 years ago. Excavated sites of the Beixin culture, Dawenkou culture, Longshan culture and other periods show the high level of development of early civilization in the region. During the Yu, Xia and Shang periods, the Dongyi people of Shandong created a brilliant culture and repeatedly clashed and merged with the Xia dynasty. Already in the Xia period the region had entered a slave-owning society, and the Shang tribe, active in Shandong, eventually founded the Shang dynasty. Under the Zhou dynasty, the long rule of fiefdoms such as Qi and Lu made the region's economy and culture among the most advanced of the time. After the unification of China by the Qin dynasty, the history of Shandong became part of the wider history of China.

Paleolithic to Neolithic Paleolithic

The fossils of Yiyuan Man (Homo erectus Yiyuanensis), discovered in Yiyuan County (today part of Zibo), are the earliest evidence of human activity yet found in Shandong. Yiyuan Man lived about 400,000–500,000 years ago, in the Paleolithic, during the Middle Pleistocene. At that time Shandong had a warm and humid climate with dense forests and vegetation, and people lived mainly by gathering and hunting. Paleolithic sites and remains have also been found elsewhere in Shandong. Taken together, these finds suggest that in the Early Paleolithic the inhabitants of Shandong spread from the Tai–Yi Mountains to the Yellow Sea coast of southern Shandong, and in the Middle and Late Paleolithic to the Jiaodong Peninsula and the coast of the Bohai Sea.

Around 10,000 years ago, Shandong entered the Mesolithic, the transition between the Paleolithic and the Neolithic. Mesolithic sites discovered in Shandong are concentrated in the Linyi area of southern Shandong and in the Wen and Si river basins of southwestern Shandong. More than one hundred sites have been found in the Linyi area, including Fenghuangling and Qingfengling in Linyi and Heilongtan and Malingshan in Tancheng; more than forty have been found in the four counties of Wenshang, Yanzhou, Ningyang and Jiaxiang in the Wen–Si basin.

Neolithic

Far more Neolithic sites have been found in Shandong than Paleolithic and Mesolithic ones: several thousand sites spread across almost the entire province. The Neolithic in Shandong is divided into the Houli culture (8400–7700 BP), the Beixin culture (c. 7300–6100 BP), the Dawenkou culture (c. 6100–4600 BP), the Longshan culture (c. 4600–4000 BP) and the Yueshi culture (c. 4000–3600 BP). Of these five stages, all except the earliest, the Houli culture (for which no direct stratigraphic superposition beneath the Beixin culture has yet been found), show direct continuity with one another. The Houli culture was distributed mainly on the alluvial plain north of the Tai–Yi Mountains and south of the Xiaoqing River. Remains of the Beixin culture have been found in Tai'an, Qingdao and Laiwu. Its people lived in matrilineal clans. The Dawenkou culture was centered on the Mount Tai area, covering central and southern Shandong and the Huaibei region of northern Jiangsu. Late sites are more widespread, extending from the Yellow Sea coast in the east to eastern Henan in the west, and from the southern shore of the Bohai Sea in the north to Huaibei in the south; remains influenced by the culture have also been found in northern Anhui and central Henan. The Longshan culture was the formative period of Chinese bronze culture. The Yueshi culture was centered on the Tai–Yi Mountains. It extended from northern Shandong and central Hebei in the north to beyond the Huai River in the south, and from the westernmost part of Shandong and the line of Lankao, Qi County and Huaiyang in Henan in the west to the Yellow Sea coast in the east. It corresponds to the period of city-state development.

Legendary period Three Sovereigns and Five Emperors

Shandong is the setting of many legends of ancient history. Geographically, the earlier figures such as Taihao and Shaohao were active in the hills of south-central Shandong, while the later figures such as Chiyou, Zhuanxu, Emperor Ku, Shun, Gao Yao and Boyi were active on the plains of northwestern Shandong and in the border areas of neighboring provinces.

Taihao, of the Feng clan, was a tribal leader of the Dongyi. The Taihao tribe was originally active in south-central Shandong; after the rise of the Shaohao tribe, it moved to the area of present-day Huaiyang, Henan (the State of Chen in the Spring and Autumn period). The Zuo Zhuan records that the Taihao clan used the dragon as its emblem. The Spring and Autumn states of Ren, Su, Xuju and Zhuanyu were said to be descendants of Taihao.

Twenty-eight years after abdicating, Yao died at the age of 118 (some accounts say 116 or 117)In his "Memorial on the Bone of the Buddha", Han Yu wrote that Emperor Yao reigned for 98 years and lived to 118. and was buried at Chengyang in Jiyin (present-day Dingtao, Shandong).

Xia dynasty During the Xia dynasty, present-day Shandong was still largely controlled by the Dongyi. Southwestern Shandong and the areas bordering present-day Henan and Hebei were strongly influenced by Xia culture, while the rest of Shandong and northern Jiangsu and Anhui had a distinct Dongyi culture. The Dongyi tribes and polities developed unevenly: some remained at the stage of clan society, while others had entered, or were entering, class society. Tribal polities began to rise; they were scattered and independent of one another, each with a relatively fixed place of residence and range of activity. Notable tribal polities in Shandong during the Xia period included Xue, Fan, Youreng, Youmin, Sanzong, Gu, Youshen, Youqiong, Youge, Guo, Han, Zhenguan, Zhenxun, Fei, Zeng, Qi and Guan.

Ancient period Shang dynasty At the end of the Xia period, the Shang tribe rose to power. In its early period the Shang tribe was centered in southwestern Shandong. The Shang ancestor Xie had his capital at Fan (in present-day Tengzhou, Zaozhuang), and Xiangtu had an eastern capital at the foot of Mount Tai. Taking advantage of the breakdown in relations between the Xia and the eastern tribes, Tang of Shang convened the "Assembly of Jingbo" with the eastern peoples and formed a broad alliance with the Dongyi, creating a coalition led by Tang, comprising the Shang and many eastern tribes, to overthrow the Xia. Archaeological evidence indicates that before the founding of the Shang dynasty, relations between the Shang and the Yi were harmonious, and the two peoples lived intermingled in the area of Qi County in eastern Henan. In the early Shang period, Shang culture in the east maintained the same boundary with the Dongyi Yueshi culture as at the end of the Xia and beginning of the Shang, while expanding steadily to the north, west and south, showing that the harmonious Shang–Yi relationship continued into the early Shang.

The early Shang capital was at Bo (in present-day Cao County). The Shang later moved its capital eight times, twice within Shandong: its fifth move took it eastward to Bi (present-day Yuncheng), and its sixth to Yan (present-day Qufu). The territory ruled by the Shang was larger than that of the Xia, and the number of polities increased further. The main polities within present-day Shandong included Yan, Pugu, Zhu, Ju, Tan, Pang, Hua, Gu, Shu, Li, Lai, Qi, Zeng, Shen and Ren.

Western Shandong, the center of the Shang tribe's activity before the dynasty was founded, remained one of the core areas of Shang rule afterwards, while eastern Shandong was ruled by the Dongyi. Relations between the Shang and the Yi were fairly harmonious in the pre-dynastic and early Shang periods, but from Zhong Ding onward, in the middle and late Shang, the Shang fought many wars with the Dongyi tribes and polities to the east. Shang power pushed steadily eastward, yet until the fall of the dynasty most of eastern Shandong remained in Dongyi hands. To secure its rule over the Dongyi who had submitted, the Shang administered them through allied states such as Yan and Pugu.

The middle Shang marked a turning point in Shang–Yi relations. The Bamboo Annals records that when Zhong Ding ascended the throne he campaigned against the Lan Yi, and the "Treatise on the Eastern Barbarians" in the Book of the Later Han states that from Zhong Ding's time the Lan Yi raided the Shang, alternately submitting and rebelling for more than three hundred years. In other words, from Zhong Ding onward Shang–Yi relations deteriorated: the Dongyi tribes alternately submitted to and rebelled against the Shang, and the Shang abandoned its tradition of friendship with the Dongyi and began waging war against them. Archaeologically, Shang remains of this period appear widely in eastern Henan and central and western Shandong, areas formerly belonging to the Yueshi culture. The Shang first occupied eastern Henan and southwestern Shandong. In northern Shandong it reached the Jinan area, establishing a regional center at Daxinzhuang; in southern Shandong it penetrated the Tengzhou area, establishing a regional center at Qianzhangda. Throughout the middle Shang, however, the Shang did not advance beyond the Xiaoqing River basin, and the vast areas of eastern Shandong and northern Jiangsu remained under Dongyi control.

In the late Shang, the dynasty continued the policy of warfare against the Dongyi begun under Zhong Ding. Dongyi groups mentioned in late Shang oracle bone inscriptions include the Yifang (also called Renfang or Shifang), the Fangyi, the Yuyi (Yufang), the Baiyi and the Huangyi. The oracle bones preserve many records of Shang campaigns against the Renfang from Wu Ding to Di Xin, the largest being under Di Xin, who launched several campaigns in response to repeated Yifang incursions. Scholars including Li Xueqin identify the Yifang as a Dongyi polity in central and eastern Shandong, with its capital in northern Shandong between the Zi River and the Wei River. Early in the late Shang, the Shang gained an advantage in northern Shandong and pushed into the Mi River basin, but did not advance eastward in southern Shandong. Shang culture and the Dongyi Zhenzhumen culture faced each other roughly along a line running from the Mi River through Mount Lu and the Si River to Tengzhou.

With the eastern campaigns of the middle Shang, some Dongyi tribes began to adopt Shang culture, in three main forms. Some were conquered and fully assimilated, such as eastern Henan, which later came under direct Shang control. Others were conquered and adopted Shang culture while retaining elements of their own, as with most of the eastern polities that submitted to the Shang: Shang culture became dominant, but each retained elements of the Yueshi culture to varying degrees. Still others, the Dongyi polities and groups never conquered by the Shang, lived mainly on the Jiaodong Peninsula, in southeastern Shandong and in northern Jiangsu; their cultures too were strongly influenced by the Shang.

Zhou dynasty

In the late Shang, the campaigns against the Dongyi seriously weakened the dynasty and sharpened social tensions. The Zhou, allied with lords across the country, launched a campaign against the Shang, overthrew its last ruler Di Xin, and founded the Zhou dynasty. To consolidate its rule, the Zhou adopted a system of enfeoffing relatives as a protective barrier for the royal house. Important fiefdoms in present-day Shandong included Qi, Lu, Cheng, Cao, Teng and Gao. Of these, Qi and Lu were by far the most influential, which is why Shandong is still called "the land of Qi and Lu" (齐鲁大地).