Rise to prominence
The warlord Liu Bei resided in the neighboring city Xiangyang under his distant relative and the governor of the Jing Province (荊州), Liu Biao. Zhuge Liang joined Liu Bei in 207 only after Liu Bei visited him personally thrice. Zhuge Liang presented his Longzhong Plan to Liu Bei and travelled to Eastern Wu to form an alliance between Liu Bei and its ruler Sun Quan.
In the Battle of Red Cliffs of 208, the allied armies of Liu Bei and Sun Quan defeated Cao Cao, thus enabling Liu Bei to establish his own territories. The historical novel Romance of the Three Kingdoms described Zhuge Liang calling forth a southeastern wind to enhance Huang Gai's fire-attack by spreading the flames across Cao Cao's ships. In reality, however, it was Zhou Yu who masterminded the fire attack. In folklore, the wind is attributed to either Zhuge Liang's magic or his ability to make accurate predictions of the weather.
The alliance with Sun Quan was broken when the Wu general Lü Meng invaded Jing Province in 219 while its defender Guan Yu was at the Battle of Fancheng. Guan Yu was captured by the Wu forces and decapitated. Liu Bei was infuriated by the execution of his longtime comrade and he ignored all advice from his subjects to hold back. He led an army to attack Eastern Wu and was defeated in the ensuing Battle of Yiling by Lu Xun. Liu died in the fortress of Baidicheng after a hasty and humiliating retreat to his own borders. After the death of Liu Bei, Zhuge Liang became the chancellor of Shu Han under Liu Shan, Liu Bei's son. He reaffirmed the alliance with Eastern Wu. Despite Liu Bei's request that Zhuge Liang assume control of Shu Han if Liu Shan proved to be an incompetent leader, Zhuge declined the offer and continued to serve Liu Shan with unwavering loyalty.