The Prince was greeted by huge, cheering crowds as he arrived in Kalk Bay, many waving South African flags.
As he took off in an impromptu walkabout, he shook dozens of hands and told locals he had enjoyed “the most amazing” few days and did not want to leave.
He was given beaded key rings to take home for his family.
Kate Wardle, 46, from Kalk Bay revealed she had had them especially made – handing him two in the shape of a W and a C and three in animal shapes for the children.
“Thank you very much, they’ll love those. Never go home empty handed, that’s important,” the Prince said.
He told the crowd: “I love Cape Town, I’ve had the most amazing week here, I’ve really enjoyed it. I don’t want to go!”
He added: “My children would love to be here, so would Catherine.”
In the harbour, a small gaggle of protesters shouted: “You’re not welcome”, “go home” and “you’ve got our diamond” – believed to be a reference to the Cullinan diamond, the largest rough-cut diamond ever found, which was mined in South Africa in 1905 before being presented to King Edward VII.
One man held a placard that said “William you have no sovereignty in our country.”
However, much larger numbers tried to yell louder to drown them out, telling them, “You don’t talk for us, we’re a rainbow nation,” and shouting: “We love you, William.”
Earlier, a group of fishermen protested because they were not included in the engagement, which was focused on sustainable fishing, despite working in the harbour.
Duwayne Baulse, 29, who has been a fisherman for 15 years, shouted angrily from his fish stall kept apart from the Prince by a cordon.