The 29-year-old woman who was accidentally shot dead was the boy's mother and a successful nuclear scientist at nearby laboratory, local media reported.
The woman, identified by a sheriff's spokesman as Veronica J. Rutledge, of Blackfoot, Idaho, died at the scene.
Officials confirmed to the Associated Press and the local CBS affiliate that the boy who reached into Rutledge's purse and accidentally discharged the gun was her son.
Rutledge worked for the Idaho National Laboratory in Idaho Falls, which supports the U.S. Department of Energy in nuclear and energy research, as well as national defense, the Spokesman Review reported.
A senior chemical engineer at the laboratory, Vince Maio, told the paper that he was immediately impressed with Rutledge when he met her.
They worked together on a research paper on using glass ceramic to store nuclear waste.
"She had a lot of maturity for her age," he told the Spokesman Review. "Her work was impeccable. She found new ways to do things that we did before and she found ways to do them better."
Video surveillance footage and eyewitness accounts helped authorities determine that the shooting was accidental.
Rutledge did have a concealed weapons permit, CBS affiliate KREM-TV reported.
Her father-in-law, Terry Rutledge, told the Associated Press that she "was not the least bit responsible" for the accident.
He told the Washington Post that the gun was concealed in a zipped compartment inside a specially designed purse at the time of the shooting.
"An inquisitive 2-year-old boy reached into the purse, unzipped the compartment, found the gun and shot his mother in the head," Terry Rutledge said. "It's a terrible, terrible incident."
He described his daughter-in-law as "a beautiful, young, loving mother."
The ramifications of the accident, he added, will be long lived for the surviving father as he has to explain to his son why his mother isn't coming home, and then later — as he gets older and has more questions — the details of what happened on Tuesday.
"He'll again have to explain what happened, so we'll have to relive this several times over," Terry Rutledge told The Post.
Walmart released a statement Tuesday, calling the fatal shooting a "very sad incident."
"A very sad incident occurred at our store today involving the death of a female customer," the statement read. "We are fully cooperating with the Kootenai County Sheriff's deputies as they investigate this matter."
Jason Wells is a news editor for BuzzFeed News and is based in Los Angeles.
Contact Jason Wells at email@example.com.
Got a confidential tip? Submit it here.