Mameluk was one of a dozen Le Hardi-class destroyers built for the French Navy during the late 1930s. The ship was completed during the Battle of France in mid-1940 and her first mission was to help escort an incomplete battleship to French Morocco only days before the French signed an armistice with the Germans in June. She then helped to escort one of the battleships damaged by the British during their July attack on Mers-el-Kébir, French Algeria, back to France in November. Mameluk returned to Morocco in early 1941 for convoy-escort duties and then was transferred back to France in late 1941.