The ship was ordered from Yarrow Shipbuilders at Scotstoun on 30 October 1935 under the 1935 Naval Programme. The ship was laid down on 12 February 1936 and launched on 11 February 1937 as the second Royal Navy warship to carry the name. "Ivanhoe" was completed on 24 August 1937 and cost £259,371 excluding items supplied by Admiralty such as guns and communications equipment. She was assigned to the 3rd Destroyer Flotilla of the Mediterranean Fleet upon commissioning and participated in training exercises with the French Navy in December through January 1938. The ship was forced to leave these exercises prematurely as she had problems with the tubes in her superheaters. These were replaced at Malta from 15 January–19 March. Afterwards, "Ivanhoe" was transferred to Gibraltar where she patrolled Spanish waters enforcing the policies of the Non-Intervention Committee until the end of the war. She was in Cartagena in February–March 1939 to protect British citizens and interests as foreigners, Republican troops and their supporters evacuated the city.