The city was founded c. 1 December 1856 as a mixed civilian-military settlement, to protect the territory against attacks by the Ranquel aboriginal tribes. The original name, Fuerte Constitucional, was changed in 1861 to Villa Mercedes by decision of the residents, who had adopted the Virgin of Mercy (Virgen de las Mercedes) as their patron.
Villa Mercedes grew quickly after a railway line from Villa María on the Central Argentine line between Rosario and Córdoba, reached the town in 1875. Built by the State-owned company Ferrocarril Andino, the line was extended to San Juan in 1885 via San Luis and Mendoza. The line from Villa Mercedes to Mendoza would become the middle section of the route from Buenos Aires to the border with Chile and was bought by the Argentine Great Western Railwayin 1887 and later became part of the Buenos Aires and Pacific Railway network.
Villa Mercedes was officially declared a city in 1896. It is now the second largest in San Luis, and an industrial and educational center, hosting a branch of the National University of San Luis.