Austria-Hungary, Germany and Italy made up the Triple Alliance in 1882. The alliance was an agreement that the countries would defend each other if threatened by France or Russia. The agreement was renewed every five years.
Italy wanted to create offshore colonies, which was the reason for the country entering into the Triple Alliance. France, Russia and Britain formed the Triple Entente in 1907, which reinforced the need for the Triple Alliance.
In 1902, Italy made a secret alliance with France despite its agreement with the Triple Alliance. In 1914, Austria-Hungary entered into war with the Triple Entente. During 1915 Italy partnered with the Triple Entente against Austria-Hungary and Germany.