Soon after, almost all overseas territories gained independence. The handover of Macau to China in 1999 marked the end of one of the longest-running colonial empires in history.