The Anchorage Daily News reports the man is an active-duty military member. Police did not reveal his name or branch.
Police spokeswoman Anita Shell says the man had left Joint Base Elmendorf-Richardson, where both Army and Air Force personnel are stationed.
Base regulations prohibit military personnel from carrying loaded, personal guns.
A 3-month-old baby and a dog were in the car.
The man parked in the Tikahtnu Commons lot just before noon and was preparing to meet his wife for lunch.
Shell says the man was seating the pistol's magazine with his finger on the trigger when it fired.
More Northwest Headlines
Patient at Western State Hospital found dead in bathroom Seattle man charged with murder, terrorism in New Jersey Summer is sizzling: Heat records fall across U.S. West Clallam County measles death is first in U.S. since 2003 Man who beat immigrant taxi driver from Seattle gets 6-month sentence Ex-Pasco cop, murder suspect accused of witness intimidation Ringleader of California-to-Spokane OxyContin operation sentenced to 50 years Wenatchee, Chelan County ban all fireworks for holiday
Our new comment system is not supported in IE 7. Please upgrade your browser here.