Soviet–Mongolian relations were governed by a "gentlemen's agreement" from 27 November 1934, which was formalised in a mutual assistance pact on 12 March 1936. This treaty created a mutual defensive military alliance, and also pledged both parties to remove troops from the territory of the other when the need for military assistance had passed. These agreements were directed at Japan, which had occupied Manchuria and advanced into Inner Mongolia, and had as their object the protection of the Soviet Trans-Siberian Railway.