Sima Qima 司馬遷, courtesy name Zizhang 子長, was a famous historian of the mid-Former Han period 前漢 (206 BCE-8 CE). His dates of life are not clear; he was probably born in 145 or 135 BCE and died during the late years of Emperor Wu 漢武帝 (r. 141-87 BCE), sometimes his death is dated 86 BCE.
He hailed from Xiayang 夏陽 (modern Hancheng 韓城, Shaanxi) and learned studying classical writings at an early age, as a student of the Confucian scholar Dong Zhongshu 董仲舒 who instructed him in the Gongyang Commentary 公羊傳 of the Chunqiu 春秋 "Spring and Autumn Annals", and of Kong Anguo 孔安國, a teacher of the old-text Shangshu 尚書 "Book of Documents".
With the age of 20 sui he traveled through the southwestern parts of the Han empire, especially the Yellow River plain and the Huai River 淮水 basin. Shortly after he was appointed gentleman of the interior (langzhong 郎中) and became an imperial guardsman (shiwei 侍衛) of Emperor Wu, accompanying him in his inspection tours to the west. On one occasion he was sent as an envoy to the region of Shu 巴 and Ba 蜀 (modern Sichuan).
In 108 BCE, he became the successor of his father, Sima Tantaishi ling 太史令), a position in which he had to observe the calendric calculations and the imperial archives. In 104 BCE he submitted the draft of the Taichu Calendar 太初曆 that he had compiled, together with Tang Du 唐都 and Luo Xiahong 落下閎. This calendar officially replaced the older and less exact Zhuanxu Calendar 顓頊曆 dating from the Qin period 秦 (221-206 BC).
Sima Qian then began to compile his famous history Shiji 史記, the first large and universal history of China that influenced countless generations of Chinese historians.
In 99 BCE an incident occurred that deeply influenced Sima Qian's personal life. Commander Li Ling 李陵 had submitted to the steppe federation of the Xiongnu 匈奴. Sima Qian defended him against the charges at the court, was put into jail and suffered the punishment of castration. He was soon pardoned and appointed Director of the Imperial Secretariat (shangshuling 尚書令), but from then on dedicated his life to the compilation of the history Shiji.
Of his many poems and rhapsodies, only a small part has survived. Another writings of him that survived is the Bao ren an shu 報任安書, a kind of autobiography focusing on his punishment and the compilation of the Shiji. Nothing is known about the rest of his life.