U-boat is the anglicized version of the German word U-Boot, a shortening of Unterseeboot, which means "undersea boat." While the German term refers to any submarine, the English one (in common with several other languages) refers specifically to military submarines operated by Germany, particularly in World War I and World War II.
Although at times they were efficient fleet weapons against enemy naval warships, they were most effectively used in an economic warfare role (commerce raiding), enforcing a naval blockade against enemy shipping. The primary targets of the U-boat campaigns in both wars were the merchant convoys bringing supplies from Canada, the British Empire and the United States to the islands of Great Britain and (during World War II) to the Soviet Union and the Allied Countries in the Mediterranean. Austro-Hungarian submarines of World War I (and before) were also known as U-boats.