During the war, parts of the Thai government kept secret ties with the Allied governments and cooperated secretly with their intelligence services. As the Japanese government surrendered in August 1945, the Thai government claimed it was never at war with the western powers, and that the declaration of war was imposed on it by the Japanese government. The US government accepted this legal interpretation, and treated the Thai government as a friendly nation. The British government, however, refused to accept this interpretation and demanded that a peace treaty be concluded.