During the early hours of 10 May 1940, Germany launched a surprise attack on the Netherlands as part of the operation to conquer France. On the same day, "Z 5" was ordered to attack German positions in Rotterdam and did so successfully. "Z 5" fired upon multiple enemy machine gun nests on the Maas bridges with her 75 mm guns while also successfully hitting German floatplanes with her 12.7 mm machine guns. On 14 May "Z 5" set sail for England to avoid capture by the Germans and arrived on 17 May at Portsmouth. She underwent repairs before returning to service on 16 June.