AYR, a sea-port, burgh and market-town, in the district of Kyle, county of Ayr, of which shire it is the capital, 87 miles (S. W. by W.) from Edinburgh, and 40 (S. S. W.) from Glasgow; containing 8264 inhabitants, and, including Newton-upon-Ayr and Wallacetown on the opposite side of the river Ayr, which are within the parliamentary boundary of Ayr, upwards of 18,000 inhabitants. This place derives its name from the river on which it is situated, and appears to have attained a considerable degree of note at a very early period. A castle was erected here by William the Lion, to which reference is made in the charter subsequently granted to the town by that monarch; and from the importance of its situation, it was besieged and taken by Edward I. during his invasion of Scotland. In 1289, Robert Bruce, on the hostile approach of an English army towards the town, finding himself unable to withstand their progress, set fire to the castle, to prevent its falling into their hands; and at present there are no vestiges of it remaining. During the usurpation of Cromwell, a very spacious and strongly-fortified citadel was erected here as a military station for his troops, for the maintenance and security of the town and harbour of Ayr, which at that time were of great importance, as enabling him to hold the western and southern parts of the county in subjection; and of this fort the greater part is still in good preservation.