Early life
Sima Qian is said to have been born around 145 BCE (some scholars say around 135 BCE). His father, Sima Tan, held the post of Grand Historian, in charge of history, astronomy and the calendar at court.
As a young man he is said to have traveled widely, visiting historic sites and hearing old stories from local people. This experience shaped his writing later on.

His father's wish and the Li Ling affair
Sima Tan died while still hoping to write a great history, and left the work to his son. Qian succeeded to the post of Grand Historian and went on with the writing.
In 99 BCE General Li Ling surrendered to the Xiongnu. Qian spoke up for him, angered Emperor Wu, and was punished by castration. He is said to have kept writing despite this humiliation and to have finished the book.
A letter he wrote to a friend ("Letter in Reply to Ren An") describes his feelings at that time, and is often said to be important for understanding the Shiji.
The Grand Historian says
At the end of most chapters Sima Qian adds his own comment, introduced by the words "The Grand Historian says". These passages show his own thinking most clearly.
