The battery was embodied with the Lowland Mounted Brigade on 4 August 1914 at the outbreak of the FirstWorld War. The brigade moved to Cupar, Fife on coast defence duties where it remained until September 1915. In late September 1915, the Lowland Mounted Brigade was dismounted and left Fife for Devonporten route to Gallipoli. The battery remained in the United Kingdom until February 1916 when it was embarked at Southampton and transported to Alexandria in Egypt. ;Service with IV Brigade IV Brigade, Royal Horse Artillery was formed in April 1916 in the Egyptian Expeditionary Force with the Ayrshire and Inverness-shire Batteries, RHA. It was assigned to the ANZAC Mounted Division to provide artillery support. In practice, the batteries were permanently attached to the mounted brigades of the division and Ayrshire RHA joined the New Zealand Mounted Rifles Brigade. The battery served with the ANZAC Mounted Division in the Sinai and Palestine Campaign throughout the rest of the war. With the division, it saw action at the Battle of Romani as part of No. 3 Section, Suez Canal Defences. This saw the repulse of the final Turkish attempt to cut the Suez Canal. The division then joined the Desert Column and with it took part in the advance across the Sinai. It fought at the Battle of Magdhaba and the Battle of Rafah. The batteries were then re-equipped with four 18 pounders each before taking part in the First and Second Battles of Gaza. ;Service with XVIII Brigade In June 1917, the Desert Column was reorganised from two mounted divisions of four brigades each to three mounted divisions of three brigades each. Consequently, the British 22nd Mounted Brigade was transferred from the ANZAC to the Yeomanry Mounted Division on 6 July 1917. With a reduction to three brigades, there was a corresponding reduction in the artillery to three batteries. The Leicestershire Battery, RHA departed on 20 June to join XX Brigade, RHA in the Yeomanry Mounted Division. This led to a reorganization of ANZAC Mounted Division's artillery. A new headquarters, XVIII Brigade, Royal Horse Artillery, was formed for the division and took command of Inverness-shire and Ayrshire RHA. They were joined by Somerset RHA of III Brigade, Royal Horse Artillery. Ayrshire RHA remained attached to the New Zealand Mounted Rifles Brigade. The batteries were still equipped with 18 pounders when the new brigade was organised but were re-equipped with 13 pounders in time for the Third Battle of Gaza at the end of October 1917. The brigade, and its batteries, remained with the ANZAC Mounted Division for the rest of the Sinai and Palestine Campaign. As part of the Desert Mounted Corps, the division took part in the Third Battle of Gaza, in particular the Capture of Beersheba and the Battle of Mughar Ridge, and the defence of Jerusalem against the Turkish counter-attacks. At the beginning of 1918, the division was attached to XX Corps and helped to capture Jericho and then formed part of Shea's Force for the First Trans-Jordan Raid. It returned to the Desert Mounted Corps for the Second Trans-Jordan Raid, the Battle of Abu Tellul and the capture of Amman. After the Armistice of Mudros, the division was withdrawn to Egypt. The Australian brigades departed for home in March and April 1919 and the New Zealanders by the end of July. The brigade was broken up some time after April 1919.
2nd Line
In accordance with the Territorial and Reserve Forces Act 1907 which brought the Territorial Force into being, the TF was intended to be a home defence force for service during wartime and members could not be compelled to serve outside the country. However, on the outbreak of war on 4 August 1914, many members volunteered for Imperial Service. Therefore, TF units were split into 1st Line and 2nd Line units. 2nd Line units performed the home defence role, although in fact most of these were also posted abroad in due course. Unlike almost all of the other Territorial Force RHA Batteries, the Ayrshire RHA did not form a 2nd line in the First World War.
Post war
The Ayrshire Royal Horse Artillery was not reconstituted in the Territorial Force in 1920.