Laid down in 1917 at the Joh. C. Tecklenborg shipyard in Geestemünde, M 107 was launched on 3 July 1918 and commissioned on 30 July of the same year.
At the end of the war, M 107 was part of the 10th half-flotilla of the 4th Minesweeping Flotilla, based at Helgoland.[2] After active service in 1918, the ship was retained by the Reichsmarine, which was renamed Kriegsmarine in 1935. On 15 April 1939, M 107 was re-classified as a Räumbootbegleitschiff for the newly established 3. Räumbootflottille and renamed Von der Groeben.
Later that year, Von der Groeben served as escort on the Belgian coast until she hit a mine off Dunkirk on 18 August 1940. The seriously damaged ship was beached and later salvaged. After repairs were completed, she was re-commissioned as M 507 on 1 October 1940.
M 507 was deployed to the English Channel coast until spring 1943, and took part of several action against British coastal forces, among them the action of 17-18 August 1942 off Gravelines, when Von der Groeben, along with five other minesweepers, escorted the Italian blockade runner Fidelitas through the English Channel; two British MTBs were sunk.