It happened in Shawnee, Kansas, over the weekend, police told CNN.
Two men attacked the 39-year-old mother as she was putting her baby in a car seat. They struck her in the back of her head, said Shawnee police Maj. Dan Tennis.
Hearing the mother's screams, the good Samaritans rushed to help.
One of them, a 33-year-old Air Force veteran, was shot multiple times when one of the attackers, later identified as John W. Simmons III, pulled out a gun.
The second rescuer had a gun of his own and he fired back, killing Simmons, police said.
The baby wasn't hurt.
Police later caught the second suspect, 27-year-old Arthur Fred Wyatt III.
On Tuesday, Wyatt was charged with attempted first-degree murder charges, aggravated kidnapping and attempted aggravated robbery. He pleaded not guilty and is being held in Shawnee jail.
The wounded good Samaritan remains hospitalized.
"My son is just a wonderful guy. He'd help anybody because that's just his nature," his mother told CNN affiliate WDAF.
The woman who was attacked has been released from hospital and reunited with her baby.
The second good Samaritan, a 36-year-old De Soto, Kansas, man, was interviewed by police and released.
The mother didn't know the suspects.