U-31 was built by TKMS, with construction taking place at the shipyards of Thyssen Nordseewerke of Emden and Howaldtswerke at Kiel. Launched on 20 March 2002, U-31 was commissioned alongside her sister ship U-32 by German Minister of Defence Peter Struck in Eckernförde on 19 October 2005. U-31 is propelled by one diesel engine and an electric motor driven by nine fuel cells, making the submarine virtually undetectable.