By 1940, Turkish air brigades had more than 500 combat aircraft in its inventory, becoming the largest air force in the Balkans and the Middle East. The growing inventory of air brigades required another structural change, which was made in 1940. The Air Undersecretariat under the Ministry of National Defense for logistical affairs and the General Staff for educational affairs were united to form the Air Force Command ("Hava Kuvvetleri Komutanlığı") in 1944. Thus, the Air Force became a separate branch of the Turkish Armed Forces. The first Commander of the Turkish Air Force was General Zeki Doğan. Turkey did not enter World War II on the side of the Allies until February 1945. However, the Turkish Armed Forces went on full alert and were prepared for war following the military alliance between neighbouring Bulgaria and the Axis Powers which was formalized in March 1941, and the occupation of neighbouring Greece by the Axis Powers in April 1941. Within a year, Turkey's borders were surrounded by German forces in the northwest and west, and Italian forces in the southwest. The Turkish Air Force made daily reconnaissance flights over Bulgaria, Greece, the Greek Islands in the Aegean Sea, and the Dodecanese Islands which then belonged to Italy, to monitor the positions of the Axis forces. The large cities in western Turkey were darkened at nights, and anti-aircraft guns and searchlights were deployed for defence against possible enemy planes. Almost all available money in the Turkish Government Treasury was used to purchase new weapons from any available provider in the world. The Turkish Air Force received large numbers of new aircraft in this period, including Supermarine Spitfire Mk.I/V/IX/XIX, Curtiss Falcon CW-22R/B, Fairey Battle-I, Avro Anson-I, Hawker Hurricane I/II, Morane-Saulnier M.S.406, Curtiss P-40 Tomahawk, Curtiss P-40 Kittyhawk, Westland Lysander-I, Consolidated B-24D Liberator B-24, Bristol Blenheim IV/V, Bristol Beaufort, Bristol Beaufighter Mk.I/X, Focke-Wulf Fw 190-A3, Martin 187 Baltimore, De Havilland DH.98 Mosquito Mk.III/IV, Douglas B-26B/C Invader, P-47D Thunderbolt and Douglas C-47A/B Dakota.