19th century, Britain's power grew enormously and the sun quite literally "never set" on the British Empire, for it had outposts on every occupied continent. It consolidated control over such far flung territories as Canada and Jamaica in the Americas, Australia and New Zealand in Oceania; Malaya, Hong Kong and Singapore in the Far East and a line of colonial possessions from Egypt to the Cape of Good Hope through Africa. All of India was under British rule by 1870. In 1804, the Shah of the declining Mughal Empire had formally accepted the protection of the British East India Company. Many Britons settled in India, establishing a rich ruling class. They then expanded into neighbouring Burma. Among the British born in India were the immensely influential writers Rudyard Kipling (1865) and George Orwell (1903). In the Far East, Britain went to war with the declining Qing dynasty of China when it tried to stop British merchants in China from selling the opium to the Chinese public. The First Opium War (1840–1842), ended in a British victory, and China was forced to remove barriers to British trade and cede several ports and the island of Hong Kong to Britain. Soon, other powers sought these same privileges with China and China was forced to agree, ending Chinese isolation from the rest of the world. In 1853 an American expedition opened up Japan to trade with first the U.S., and then the rest of the world. In 1833 Britain ended slavery by buying out all the owners throughout its empire after a successful campaign by abolitionists. Furthermore, Britain had a great deal of success attempting to get other powers to outlaw the practice as well. As British settlement of southern Africa continued, the descendants of the Dutch in southern Africa, called the Boers or Afrikaners, whom Britain had ruled since the Anglo-Dutch Wars, migrated northward, disliking British rule. Explorers and missionaries like David Livingstone became national heroes. Cecil Rhodes founded Rhodesia and a British army under Lord Kitchener secured control of Sudan in the 1898 Battle of Omdurman. Canada: 1815–1870 Following the American Revolution, many Loyalists to Britain fled north to what is today Canada (where they were called United Empire Loyalists). Joined by mostly British colonists, they helped establish early colonies like Ontario and New Brunswick. British settlement in North America increased, and soon there were several colonies both north and west