After training with the "4th U-boat Flotilla", U-171 was transferred to the 10th U-boat Flotilla for front-line service on 1 July 1942. It was sent to patrol in the Gulf of Mexico. It was sunk by a naval mine in the Bay of Biscay 115 days into its first and only patrol, whilst returning to Lorient in occupied France, with the loss of 22 of its crew of 54. For many years it was believed was sunk by an American aircraft in what was, in reality, an unsuccessful attack on it in the Gulf of Mexico.