As Guangzhou became China's key commercial center for foreign trade and exchange in the 1700s, Cantonese became the variety of Chinese interacting most with the Western World. Around this period and continuing into the 1900s, the ancestors of most of the population of Hong Kong and Macau arrived from Guangzhou and surrounding areas after they were ceded to Britain and Portugal, respectively. After the Xinhai Revolution of 1912, Cantonese almost became the official language of the Republic of China but lost by a small margin.