During the Napoleonic Wars, Memel became the temporary capital of the Kingdom of Prussia. Between 1807 and 1808, the town was the residence of King Frederick William III, his consort Louise, his court, and the government. On 9 October 1807 the king signed a document in Memel, later called the October Edict, which abolished serfdom in Prussia. It originated the reforms of Karl Freiherr vom und zum Stein and Karl August von Hardenberg. The land around Memel suffered major economic setbacks under Napoleon Bonaparte's Continental System. During Napoleon's retreat from Moscow after the failed invasion of Russia in 1812, General Yorck refused Marshal MacDonald's orders to fortify Memel at Prussia's expense.