After steaming to the U.S. East Coast, "Mainstay" underwent shakedown in Chesapeake Bay and joined Mine Division 32 on 21 July. Three days later she departed for the Mediterranean, and, as escort for convoy UGS-49, arrived Oran, Algeria, 10 August. On the 15th she sailed for minesweeping operations in support of the Allied invasion of southern France on the coast of Provence. She closed the French coast 20 August, and during the next two months she swept for enemy mines from Marseilles, France, to San Remo, Italy. While sweeping coastal waters between Menton, France, and Ventimiglia, Italy, she came under fire from German shore batteries on 9 and 10 September and engaged the enemy guns with 3-inch gunfire. In addition, she helped repel an attack by submerged, one-man "human torpedoes" on gunfire support ships on the 10th.