As in the First World War, Brazil stayed neutral during the opening years of the Second World War, until U-boat attacks drove the country to declare war on Germany and Italy on 21 August 1942. The age and condition of "São Paulo" relegated it to the role of harbor defense ship; it set sail for Recife on 23 November 1942 with the escort of two American destroyers ( and ) and served as the main defense of the port for the war, only returning to Rio de Janeiro in 1945. Stricken from the naval register on 2 August 1947, the ship remained as a training vessel until August 1951, when it was sold to the Iron and Steel Corporation of Great Britain for breaking up.