Ainay-le-Vieil (; 'Ainay-the-Old') is a rural commune in the Cher department in the Centre-Val de Loire region of France, bordered to the north and east by the river Cher, about 48 km (30 mi) south of Bourges. It is on the departmental border with Allier at Lételon (which is also the regional border with Auvergne-Rhône-Alpes).