Special Agent Victor Avila Jr. was discharged from the hospital on Wednesday.
Avila and fellow agent Jaime Zapata were targeted in an attack as they traveled from Mexico City to San Luis Potosi on Tuesday. The agents stopped their vehicle at a checkpoint, which turned out to be a setup. Officials say it's a tactic often used by drug traffickers.
Zapata, 32, was killed in the attack.
Investigators believe the checkpoint was staffed by members of a notorious drug cartel known to control much of northern Mexico.
Zapata's murder is the latest in what appears to be targeted attacks on federal agents. Last year, Border Patrol agent Brian Terry was shot and killed in a gun battle in the Arizona desert. Another Border Patrol agent Robert Rosas was killed in Mexico, just south of San Diego.
U.S. and Mexican authorities continued to investigate the shooting.