Upon Perceval's assassination in 1812, the new Prime Minister, Lord Liverpool, offered Canning the position of Foreign Secretary once more. Canning refused, as he also wished to be Leader of the House of Commons and was reluctant to serve in any government with Castlereagh. Castlereagh was appointed Foreign Secretary by Liverpool, replacing Wellesley who had resigned. Castlereagh remained in the post until his suicide in 1822, overseeing British participation in the final years of the Napoleonic Wars and the Congress of Vienna which redrew the map of Europe.