The historical Cao Cao (曹操, pinyin Cao2 Cao1) was the son of a court official of the Han Dynasty. Cao Cao himself held positions at this court until an attempted coup by General Dong Zhuo[?] brought down the dynasty. Dong Zhuo was not able to consolidate his hold on the empire and China fell into civil war and anarchy.
In the resulting chaos Cao Cao emerged as the military ruler of northern China, winning a critical battle (the Battle of Guandu) at the Yellow River. He basically "kidnapped" the Han royalty and appointed himself as prime minister. He extended his control north past the Great Wall, into northern Korea, and south to the Han River. The area under his control became known as the Kingdom of Wei (魏). His attempt to cross the Yangtze River futher to the south met with failure as he clashed with the combined forces of Liu Bei (ruler of the Kingdom of Shu-Han in southwestern China) and Sun Quan (ruler of the Kingdom of Wu in southeastern China) at the Battle of Red Cliff.
Cao Cao battled with these two kingdoms for 30 years but was unable to extend his control south of the Yangtze as long as the two weaker kingdoms remained united against him. The resulting period of stasis is known as the Three Kingdoms period in Chinese history. Cao Cao's descendents were to rule for 40 years after his death in 220 AD before being usurped by the Sima clan. The Sima clan ultimately conquered the southern kingdoms to establish the Jin Dynasty, which itself was only able to hold the country together for a brief period before China was split again in the period of the Southern and Northern Dynasties.
While the historical record indicates Cao Cao was a brilliant ruler and poet, in classical Chinese literature he is traditionally represented as a cunning and deceitful general. This is likely due to a subsequent Buddhist interpretation of events which would have attributed his failure to unify China to flaws in his character.