Most of the alliances of World War I had been formed for years before the war even began. Germany and Austria-Hungary formed the Dual Alliance in 1879, with the agreement that they would remain a united force if Russia was at war against them. Soon Italy joined the Dual Alliance and it became the Triple Alliance. Italy also made an agreement with France if Germany were to attack them. Britain, Russia, and France formed the Triple Entente.
After the war began, Italy decided that Germany had violated the terms of their allegiance. Italy was able to remain neutral for the first year of the war because of this. Eventually, Italy joined the Triple Entente because of the promise of land in 1915. Land to the north of Italy belonged to Austria-Hungary, even though it was primarily populated by Italians.
Serbia and Montenegro became allied with Russia during the early parts of the war. In 1917, the United States joined the war on the side of the Triple Entente. Siam, Greece, and Liberia did the same in 1917. Japan had also joined this alliance in 1914, shortly after the start of the war. Russia withdrew from the alliance before the war ended.