The 300-year-old Treaty of Utrecht, which is currently in the British Library, was signed to end the war of Spanish succession and gives Britain the right to Gibraltar.
The treaty, which was seen today by ITV News Europe Editor James Mates, says the territory is Britain's "to hold forever, without any impediment or exception whatsoever".
Despite being signed on April 11, 1713, the document remains legal.
More top news
The author said "It's been wonderful" as fans mark two decades since the children's books opened up a world of magic to millions.
There was something very striking about the pact, which implies the new agreement could remain in place even if the prime minister does not.
The royal will visit the site of the deadly attack at Manchester Arena as he remembers those killed and injured.