King Knut (or Canute) had a bunch of courtiers who were rather too good in their flattery.
So I don't know the details exactly, but anyways, he went to the seaside, had his throne plonked on the beach, and he told the rising tide to go away.
The story is widely understood to be about a megalomaniac king who thought he could do anything.
The reality is the opposite - that he was teaching his courtiers a lesson that he WASN'T omnipotent, and that all their flattery was a load of hot air.
It's near the bottom of the wikipedia page on "King Canute".