When Confucius was trapped in Kuang, he said: “King Wen is dead, but the civilization he created lives on with me, doesn’t it? If Heaven wished civilization to be destroyed, why was it entrusted to me? If Heaven doesn’t wish civilization to be destroyed, what do I have to fear from the people of Kuang?”
Confucius is said to have fled along with his disciples to Kuang, a rough border town located in the modern-day Changyuan County (長垣縣) in Henan province (河南省), in 496 BC from the state of Song where he had been threatened by a minister called Huan Tui (桓魋).
When he arrived there, Confucius was mistaken by the locals for a notorious outlaw from the state of Lu called Tiger Yang (楊貨) who had previously ransacked the town, and had to invoke his self-proclaimed stewardship of the legacy of his hero, the Duke of Zhou (周公), to calm the fears of his disciples.
I’m not sure whether it was this argument that persuaded the good people of Kuang to let him go, but somehow Confucius managed to talk himself out of danger.
According to some commentators, this passage in Book 7, Chapter XXII is also a variant of this same story.