During the Spring and Autumn period, the small state of Jiao, located northwest of present-day Yun County in Hubei, neighbored the powerful state of Chu.
In 700 BCE, the Chu army laid siege to the Jiao state, camping outside the southern gate of the Jiao capital. The Jiao defenders holed up inside, refusing to come out, leaving the Chu forces unable to breach the city.
Qu Xia, the Mo'ao (an official title) of Chu, said to the King of Chu, "The state of Jiao is small, and its people are frivolous; frivolous people lack strategy. We can send some men to cut firewood on their mountains without protection, thus luring the people of Jiao out."
King of Chu followed Qu Xia's strategy and sent a group of people to cut firewood on the Jiao people's mountain. The Jiao people spotted the Chu men chopping wood on their mountain without any military protection, so they dispatched troops from the city to capture them, easily taking thirty prisoners and returning to the city in triumph.
The next day, the Chu army sent a large group of men into the mountains to gather firewood. Having tasted easy gains, the people of Jiao eagerly rushed out of the city, chasing after the Chu woodcutters. But this time, the Chu forces had laid a trap: they blocked the northern gate of Jiao's capital, cutting off the Jiao people's retreat, while ambush troops hidden in the mountains sprang forth, routing the Jiao forces completely. The Chu king then forced the Jiao ruler to sign a humiliating treaty under the city walls before withdrawing his army back to Chu.
Later, the idiom "a treaty signed under the city walls" came to describe being forced into a humiliating agreement when the enemy is at the gates.
Source: *Zuo Zhuan*, "Duke Huan's Twelfth Year"
Meaning of the Idiom: Later, the Chinese idiom "城下之盟" came to describe being forced into a humiliating agreement when the enemy is at the gates.