Original: The war ended in 1918, but Dönitz remained in a British camp as a prisoner of war until his release in July 1919.
Simplified: He ended the war as a prisoner-of-war of the British.