Cristina Fernández de Kirchner was greeting supporters outside her home when a man emerged from the crowd and pointed a handgun in her face.
President Alberto Fernández said the gun was loaded with five bullets but failed to fire when triggered.
Ms Fernández de Kirchner is involved in 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.
Addressing the nation late on Thursday night, President Fernández said: “Cristina remains alive because for a reason not yet technically confirmed, the gun, which contained five bullets, did not fire.”
He went on to condemn the attacker and said the attempt on Ms Fernández de Kirchner’s life was one of the “most serious” incidents since the country returned to democracy in 1983.
He also declared a national holiday on Friday to allow Argentines time to “express themselves in defence of life, democracy and in solidarity with our vice president”.
Footage shared on local media showed the man aiming a gun inches away from her head and appearing to attempt a shot. She then lowers her head but no shots were fired.
El video del arma contra @CFKArgentina pic.twitter.com/8j1xpMnPoe
— Lautaro Maislin (@LautaroMaislin) September 2, 2022