The Glasgow & South-Western railway owns most of the lines within the shire, its system serving all the industrial towns, ports and seaside resorts. Its trunk line via Girvan to Stranraer commands the shortest sea passage to Belfast and the north of Ireland, and its main line via Kilmarnock communicates with Dumfries and Carlisle and so with England. The Lanarkshire & Ayrshire branch of the Caledonian railway company also serves a part of the county. For passenger steamer traffic Ardrossan is the principal port, there being services to Arran and Belfast and, during the season, to Douglas in the Isle of Man. Millport, on Great Cumbrae, is reached by steamer from Fairlie.
The population of Ayrshire in 1891 was 226,386, and in 1901, 254,468, or 223 to the sq. m. In 1901 the number of persons speaking Gaelic only was 17. The chief towns, with populations in 1901 are: Ardrossan (6077), Auchinleck (2168), Ayr (29,101), Beith (4963), Cumnock (3088), Dalry (5316), Darvel (3070), Galston (4876), Girvan (4024), Hurlford (4601), Irvine (9618), Kilbirnie (4571), Kilmarnock (35,091), Kilwinning (4440), Largs (3246), Maybole (5892), Muirkirk (3892), Newmilns (4467), Saltcoats (8120), Stevenston (6554), Stewarton (2858), Troon (4764). The county returns two members to parliament, who represent North and South Ayrshire respectively. Ayr (the county town) and Irvine are royal burghs and belong to the Ayr group of parliamentary burghs, and Kilmarnock is a parliamentary burgh of the Kilmarnock group. Under the county council special water districts, drainage districts, and lighting and scavenging districts have been formed. The county forms a sheriffdom, and there are resident sheriffs-substitute at Ayr and Kilmarnock, who sit also at Irvine, Beith, Cumnock and Girvan. The shire is under school-board jurisdiction, but there are a considerable number of voluntary schools, besides secondary schools at Ayr, Irvine, Kilmarnock and Beith, while Kilmarnock Dairy School is a part of the West of Scotland Agricultural College established in 1899. In addition to grants earned by the schools, the county and borough councils expend a good deal of money upon secondary and technical education, towards which contributions are also made by the Glasgow and West of Scotland Technical College and the Kilmarnock Dairy School. The technical classes, subsidized at various local centres, embrace instruction in agriculture, mining, engineering, plumbing, gardening, and various science and art subjects.
Traces of Roman occupation are found in Ayrshire. At the time of Agricola's campaigns the country was held by the Damnonii, and their town of Vandogara has been identified with a site at Loudoun Hill near Darvel, where a serious encounter with the Scots took place. On the withdrawal of the Romans, Ayrshire formed part of the kingdom of Strathclyde and ultimately passed under the sway of the Northumbrian kings. Save for occasional intertribal troubles, as that in which the Scottish king Alpin was slain at Dalmellington in the 9th century, the annals are silent until the battle of Largs in 1263, when the pretensions of Haakon of Norway to the sovereignty of the Isles were crushed by the Scots under Alexander III. A generation later William Wallace conducted a vigorous campaign in the shire. He surprised the English garrison at Ardrossan, and burned the barns of Ayr in which the forces of Edward I were lodged. Robert Bruce is alleged to have been born at Turnberry Castle, some 12 m. S.W. of Ayr. In 1307 he defeated the English at Loudoun Hill. Cromwell paid the county a hurried visit, during which he demolished the castle of Ardrossan and is said to have utilized the stones in rearing a fort at Ayr. Between 1660 and 1688 the sympathies of the county were almost wholly with the Covenanters, who suffered one of their heaviest reverses at Airds Moss - a morass between the Ayr and Lugar, - their leader, Richard Cameron, being killed (20th of July 1680). The county was dragooned and the Highland host ravaged wherever it went.
The Hanoverian succession excited no active hostility if it evoked no enthusiasm. Antiquarian remains include cairns in Galston, Sorn and other localities; a road supposed to be a work of the Romans, which extended from Ayr, through Dalrymple and Dalmellington, towards the Solway; camps attributed to the Norwegians or Danes on the hills of Knockgeorgan and Dundonald; and the castles of Loch Doon, Turnberry, Dundonald, Portencross, Ardrossan and Dunure. There are ruins of celebrated abbeys at Kilwinning and Crossraguel, and of Alloway's haunted church, famous from their associations.
See James Paterson, "History of the County of Ayr." Transactions of Ayrshire and Galloway Archaeological Associations, Edinburgh, 1879-1900; John Smith, Prehistoric Man in Ayrshire (London, 1895); William Robertson, History of Ayrshire (Edinburgh, 1894); Archibald Sturrock, "On the Agriculture of Ayrshire," Transactions of Highland and Agricultural Society; D. Landsborough, Contributions to Local History (Kilmarnock, 1878).