One of those killed was a gunman who opened fire at the deputies, said Kitsap County Sheriff's spokesman Scott Wilson.
A young woman or teenager who was at the scene also died later at Tacoma General Hospital of gunshot wounds she sustained in the shoot-out.
Witnesses said the woman was seen with the gunman in the store earlier in the day, but investigators don't know yet what, if any connection she had to the gunman.
The two injured deputies were rushed to Tacoma General as well, Kitsap County Sheriff Steve Boyer said. The deputies were listed in serious condition with non-life-threatening wounds to their torsos.
A third deputy who was at the scene was not injured.
Wilson said deputies had responded to the store after receiving a call from a customer about a suspicious person.
When deputies arrived, at about 3:45 p.m., the suspect ran away through the store parking lot, then turned around and began firing at officers. Deputies returned fire and shot the man dead.
Witnesses at the scene told KOMO News they heard several shots fired outside the Walmart store at 3497 Bethel Road SE near Port Orchard in Kitsap County.
"I heard one shot, which I thought was a car backfiring, and then several more reported back, which I knew to be gunfire," said witness Victor Meyers.
Another witness, Ray Bourge, said he saw the suspect running through the parking lot towards the woods, firing his gun backwards toward the store.
"I was exiting Walmart and to my left, about 100 feet away, I saw a gentleman running towards the woods there, and right behind him there was an officer chasing him, and he began to open fire," Bourge said.
Witness Destany Droge added: "(The gunman) pulled out a gun and wasn't even watching what he was doing."
Patrol cars respond to the scene of the shoot-out.
Bourge said the officer was about 30 to 40 feet behind the suspect when he started firing.
"Five or six shots were fired. ... I just went and took cover," he said.
Another witness said he saw a female deputy running toward one of the injured deputies on the ground before he and other witnesses were hustled away from the scene.
Police later said that female deputy was the one who shot and killed the gunman.
A Walmart spokesperson said the store went into lockdown with about 100 customers still inside after the shootings.
All roads in the immediate vicinity were blocked as police and deputies responded to the scene.
"This hits all of us when something like this happens," said Jeff Gollihur, who lives in the area. "It's not just a crime against a police officer or against a sheriff's deputy. This is a crime against our entire community."
The Washington State Patrol will lead the investigation into the incident, with assistance from the FBI.
Officers were responding from Kitsap and Mason counties, the Washington State Patrol and from all fire districts in the area.