After the outbreak of World War II in September 1939, the government of Regent Prince Paul of Yugoslavia declared its neutrality. Despite this, and with the aim of securing his southern flank for the pending invasion of the Soviet Union, Adolf Hitler began placing heavy pressure on Yugoslavia to sign the Tripartite Pact and join the Axis. After some delay, the Yugoslav government conditionally signed the Pact on 25 March 1941. Two days later a putatively anti-Axis bloodless coup d'état deposed Prince Paul and declared 17-year-old Prince Peter II of Yugoslavia of age. Ostojić had a close relationship with one of the main instigators of the coup, the deputy commander of the JKRV, "Brigadni đeneral" Borivoje Mirković, and was personally involved in the coup. Ostojić escorted Prince Paul to exile in Greece and then travelled on to Cairo.