Following the successful Allied Burma Campaign and the fall of Rangoon, Ayer retreated out of Burma with Bose and about 100 members of the Rani of Jhansi Regiment by foot for Bangkok and onwards to Singapore. After the Japanese surrender, Ayer was chosen to leave Singapore for an unknown destination together with Bose and two other members of the Azad Hind cabinet. On Bose's last flight from Formosa to an unknown destination, there was no room for Ayer. The plane crashed on August 17, 1945 and Bose died the following day. Ayer was flown from Tokyo to Delhi in November 1945 to give evidence in the Red Fort Trials and became a key defence witness in the first trial. In 1951, Ayer published his personal accounts of the Indian National Army and Subhas Chandra Bose called "Unto Him a Witness: The Story of Netaji Subhas Chandra Bose in East Asia, Bombay, 1951".