Cristina Fernandez de Kirchner was greeting supporters outside her home when a man emerged from the crowd and pointed a handgun in her face.
President Alberto Fernandez said the gun was loaded with five bullets but failed to fire when triggered.
Ms de Kirchner is in the midst of a corruption trial and was returning from court. She denies the charges.
Police said the gunman, who local media identified as a 35-year-old Brazilian man, has been taken into custody. They are attempting to establish a motive for the attack.