The drama began as a Kitsap County deputy and the sergeant were investigating a string of burglaries in the Navy Yard City neighborhood.
As the sergeant and deputy were conducting a slow patrol through the neighborhood, they spotted a man who was acting suspicious, so they stopped to make a "social contact" with him, said Scott Wilson of the Kitsap County Sheriff's Office.
The next minute, the man pulled out a handgun and opened fire at the sergeant, Wilson said. The sergeant fired back, and the man took off running through backyards and alleyways in the neighborhood.
Deputies chased after the man on foot and took him into custody on Charlotte Avenue between D and E streets. He gave up without further resistance, Wilson said. The man's handgun was later recovered.
The 29-year-old suspect was booked into Kitsap County jail for investigation of first-degree assault. He is being held on $1 million bail.
No one was injured in the exchange of gunfire.
The sergeant, who has been with the Sheriff's Office for about 20 years, has been placed on administrative assignment while the shooting is investigated by the Washington State Patrol.
Wilson said the sergeant's training kicked in when the suspect pulled a gun on him.
"Most law enforcement agencies are well aware that at the blink of an eye a situation that starts out as a social contact can turn deadly," he said.