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
Yakima youngsters mix Legos, science education Activists rappel off Oregon bridge to stop Shell icebreaker Stanwood man pleads guilty to stealing from Swinomish tribe Death penalty dropped from Carnation killings trial Poll: Just 30 percent inclined to re-elect Gov. Inslee GOP lawmakers want Washington to look at Planned Parenthood Salvation Army sets up charging ports for Portland homeless Spokane criminal faces 30th felony charge
Our new comment system is not supported in IE 7. Please upgrade your browser here.