A draft letter of abdication written by King George III during the American War of Independence is among royal papers which will be available for public viewing for the first time.
The handwritten letter was composed by the monarch - who was often called "the mad king" - after difficulties in forming a government during the political crisis of March 1783.
It is one of 350,000 pages from the Georgian collection in the Royal Archives which will be digitised and available to view online.
The page, which was never deployed, is full of crossing out and redrafting, as well as blotches and scrawls.
In it, the king said he intended to exile himself to Hanover after he resigned his crown.
The exploration of the Georgian archive, which includes the private papers of George III and his wife Charlotte, is the subject of a new documentary, George III: The Genius Of The Mad King, which will air on BBC Two later this month.
Filmmakers had access to the Royal Archives in Windsor Castle as academics and historians uncovered letters that showed the king had a network of private agents.
One, code-named Aristarchus, asked for payment for the intelligence that the French were plotting to assassinate the king as he walked at night in the Queen's Garden.
Another discovery was a blonde lock of the hair of Prince Alfred, who died when he was a baby, sewn into a letter from Charlotte to his governess, Lady Charlotte Finch.
The academics also uncovered a letter in which the king told his prime minister Lord North that the Prince of Wales had an "improper connection" with an actress who was blackmailing him and revealed Lord North duly paid her off.
Also among the papers was an instruction manual written by George's father Frederick on how to be king, telling him "never give up your honour" and issuing a warning about racking up the national debt.
The papers show George, who was the last king of America, took a voracious interest in the details of the American War of Independence.
They detail the needs of his army, closely monitor the progress of his children, and keep detailed height charts for his 15 offspring.
Andrew Lambert, Laughton Professor of Naval History at King's College London, tells the documentary: "The king takes his job very seriously. He is processing knowledge on a proto-industrial scale as a part of his role.
"He's the best informed chief executive this country has ever had."
The documentary marks the launch of a global online portal, which will see 350,000 pages from the Georgian collection in the archives digitised over the next three years and made available freely to the public to view.
Just 15% of the papers have been published before and the full collection reveals previously unseen details of the king's breakdowns.
The journal of his equerry documents his affliction and shows the household called on a lunacy specialist to help him.
The Georgian Papers Programme, launched on April 1 2015 by the Queen, will transform access to papers in the Royal Archives and Royal Library covering 1714-1837.
:: George III: The Genius Of The Mad King is on BBC Two at 9pm on January 30.