Aguilar, or in full Aguilar de la Frontera, is a municipality and town in the province of Córdoba, Andalusia, southern Spain, near the small river Cabra, 50 kilometers from the provincial capital, Córdoba, on the Córdoba-Málaga railway.