In 1940, Estonia became a constituent republic of the Soviet Union, as part of a secret territory-dividing agreement in the German–Soviet Nonaggression Pact of August 1939. During the Soviet era, the Estonian church's decision to break with Moscow in favor of Constantinople was ruled illegal. Consequently, the church lost its autonomy and was merged into the Russian Orthodox Church on 28 February 1941. More than half of the Estonian Orthodox clergy resigned in protest.