In 1942, the Imperial Japanese Army invaded the Federated Shan States from Thailand. The Japanese forces with superior air power went on to dislodge the Nationalist Chinese forces, who had been invited by the British for the region's defence, by November 1942. The Thai Phayap Army accompanied the Japanese forces on the invasion, including that of Kengtung in May 1942. The IJA allowed the Phayap Army to occupy Kengtung and parts of Mongpan state. Following the existing agreement between Thai Prime Minister Plaek Phibunsongkhram  and the Japanese Empire, on 18 August 1943, the Japanese government agreed to the Thai annexation of Kengtung and Mongpan states  The Thai government wanted the Karenni states and remaining southern Shan states but the Japanese assigned them to their client State of Burma in September 1943. The Thai army would remain there until the end of the war although the Thai government began to alter its position when the tide of war began to favour the allies. After the Phibun government fell in August 1944, the new government of Khuang Aphaiwong communicated to the British government it renounced all claims to the Shan states and northern Malaya, and that it would immediately return the territories to Britain. The Churchill government did not accept the Thai overture, and was prepared to retaliate. The Thai army evacuated the two Shan states only in August 1945.. How many months did the Thai's occupy the Shan states after being granted them in August of 1943?