In 354 BC, the state of Wei attacked Zhao and laid siege to its capital, Handan.
Zhao sought help from Qi. The Qi general, Sun Bin, determined that a direct confrontation with the Wei army was unwise. Instead, he led his forces to attack the Wei capital, Daliang.
Upon learning his capital was under attack, the Wei general Pang Juan hastily withdrew his army to defend it. During their rushed retreat, the exhausted Wei troops were ambushed and decisively defeated at the Battle of Guiling.
Thus, Zhao was rescued. Pang Juan barely escaped back to Wei to recoup his losses.