After the Zanzibar Revolution overthrew the Arab dynasty in neighbouring Zanzibar, accompanied with the slaughter of thousands of Arab Zanzibaris, which had become independent in 1963, the archipelago merged with mainland Tanganyika on 26 April 1964. The new country was then named the ''United Republic of Tanganyika and Zanzibar''. On 29 October of the same year, the country was renamed the United Republic of Tanzania ("Tan" comes from Tanganyika and "Zan" from Zanzibar). The union of the two hitherto separate regions was controversial among many Zanzibaris (even those sympathetic to the revolution) but was accepted by both the Nyerere government and the Revolutionary Government of Zanzibar owing to shared political values and goals.