Tibetan was semi-independent from China since around 1911, when the Last Dynasty of China - Qing dynasty transferred power to its successor - Republic of China.
Under Qing dynasty, Tibet was a distinct region under Central Government, who presided the religious ritual of selecting reborn Dalai Lama, deployed army in Tibet and appointed Federal Government Official in Tibet. Tibetans had autonomy on interior affaris.
In 1911, the Emperor of Qing Dynasty resigned and the republicans took the control of China. After that, China had experienced years of internal wars between warlords and invasion from Japan. During this time, the Central government had virtual no power on Tibet. Tibetans then gained control of Tiibet and China had only symbolic sovereignty over Tibet.
In 1949, the ruling KMT was ousted to Taiwan by Chinese Communist Party, who then defeated the local Tibetan army and Dalai Lama surrendered to Chinese army in 1951. Ever since then, China regain control to Tibet.