The king then built a gallows by the palace gate.
"Truthtellers shall pass through; liars will be hanged!" the king declared.
Nasruddin arrived at the gate.
"Where are you going?" asked the king.
"I'm going to be hanged."
"You are lying!" protested the king.
"Correct," said Nasruddin, "I was on my way to the barber. So hang me!"
Then he grinned. "But you can't hang me, can you? Because then I'd be telling the truth."
Thus Nasruddin persuaded the king to revoke his decree and take down the gallows.
Inspired by: The Exploits of the Incomparable Mulla Nasrudin by Idries Shah, free to read online at the Idries Shah Foundation.
Notes: This is story 7 in the book. This is in the genre "liar" paradoxes, like the famous Cretan liars; more at Wikipedia: Epimenides paradox.