On the death of Samoa's King Malietoa Laupepa (d. 1898), his long-time rival Mataafa (d. after 1899) returned from exile aboard a German warship and was shortly elected the Samoan king as virtually a German puppet. The US and British consuls strongly opposed him, backing instead the dead king's son. Fighting erupted between Samoans; in January 1899, the capital city of Apia was thrown into chaos with foes fighting in the streets, looting, and burning buildings. At first Mataafa and his Samoan and German supporters gained the upper hand until US and British warships shelled Apia (March 15, 1899). Anglo-American troops took control of coastal roads, but were unable to defeat the enemy in the interior. All fighting ceased with the arrival of a tripartite (US-British-German) commission on May 13, 1899. Both sides agreed to give up their firearms, for which they were fairly compensated, and the monarchy was abolished. By the tripartite treaty (1899), Germany received the western Samoan islands, of which Savaii and Upolu (the site of Apia) are the most important; the United States obtained the eastern islands (American Samoa, with its capital at Pago Pago on Tutuila); and Britain withdrew from the area for recognition of rights on Tonga and the Solomons.