After Italy had entered World War I by declaring war on Austria-Hungary on 23 May 1915, Germany felt treaty-bound to support the Austrians in attacks against Italian ships, even though Germany and Italy were not officially at war. As a result, German U-boats operating in Mediterranean were assigned Austro-Hungarian numbers and flags. In some cases the same Austro-Hungarian numbers were assigned to different German U-boats.