Undercover officers were attempting to buy drugs from the 33-year-old man around 1:15 a.m. near 25th Avenue and East Fir Street when the man took off on foot.
Police wrestled the man to the ground, and say he tried to pull a 9mm handgun from his waistband while another officer had him pinned.
"One of the officers was able to strip the gun from the suspect's hand," Detective Mark Jamieson said.
Almost eight grams of crack cocaine was found on the man.
The arrest was part of a narcotics operation in the East Precinct, and police booked the man in to King County Jail on gun and drug offenses.