Hitler appointed Dönitz as his successor shortly before his suicide. Dönitz served as President of the Reich (although in reality his government controlled little outside of the northern city of Flensburg) for 23 days and was instrumental in finalizing the German surrender.