The rural outpost that later became Pilar was first assigned a local authority in 1774 with the appointment of Ventura López Camelo as its first alcalde, or mayor. Pilar is the site where the Treaty of Pilar was signed on February 23, 1820, establishing the basis for Argentine federalism, as a result of which the city of Pilar is acknowledged as the “Cradle of National Federalism.” This Treaty marked the end of the war between the League of Free Peoples formed by the provinces of Entre Ríos and Santa Fe against Buenos Aires.
The Parish of Our Lady of the Pillar was consecrated in 1856, and the partido (county) of Pilar was established in 1864. The first railway line built by the Buenos Aires and Pacific Railway reached the town in 1886, and by 1895 nearly 10,000 inhabitants lived in Pilar. The opening of National Route 8 in 1934 eased the 58 kilometres (36 mi) commute to Buenos Aires, and Pilar subsequently became a growing commuter town.
Pilar grew further after the construction in the late 1960s of a freeway along the stretch of National Route 8 to Buenos Aires, and with the establishment in 1970 of the local industrial district, the Parque Industrial Pilar. The establishment of the first polo fields beginning in the late 19th century and of a number of country clubs from 1948 onward, as well as the development of numerous gated communities beginning in the 1990s, gave Pilar an increasingly upscale profile in subsequent years.