No. 4 Squadron was established as a unit of the Australian Flying Corps (AFC) at Point Cook, Victoria, on 16 October 1916. According to the unit war diary, Captain Andrew Lang took command of the squadron and its initial complement of one officer and 26 men on 25 October. Shortly after its formation the squadron departed for Britain, arriving at Castle Bromwich for further training in March 1917.
The unit arrived in France on 18 December 1917. During its time on the Western Front, it was assigned to No. 80 Wing. Operating Sopwith Camels and Snipes, it performed fighter sweeps, provided air support for the army, and raided German airstrips. No. 4 Squadron claimed more "kills" than any other AFC unit: 199 enemy aircraft destroyed. In addition, 33 enemy balloons were destroyed or driven down.
Members of the unit included Captain Harry Cobby, the AFC's leading ace of the war, credited with destroying 29 aircraft and observation balloons, and Captain George Jones, who shot down seven aircraft and later served as the RAAF's Chief of the Air Staff for ten years. Aces Roy King, Edgar McCloughry, Herbert Watson, Thomas Baker, Leonard Taplin, Thomas Barkell, Arthur Palliser, Norman Trescowthick, Garnet Malley and Albert Robertson also served in the squadron.
Following the armistice, No. 4 Squadron remained in Europe and was based in Cologne, Germany, as part of the British Army of Occupation. It returned to Australia in March 1919 and was disbanded in Melbourne in June.
No. 4 Squadron was re-formed as a general reconnaissance unit at RAAF Station Richmond, New South Wales, on 3 May 1937.