OMAK, Wash. (AP) _ A shootout in an alley outside a motel left one police officer dead and a second officer and the gunman wounded.

A 45-year-old officer died early this morning at Harborview Medical Center in Seattle, where he was flown after the shooting, Okanogan County Sheriff Jim Weed said.

The other wounded officer was being treated at an Omak hospital for a gunshot wound to the left thigh. The 36-year-old officer was alert and talking and his injury is not life-threatening, Weed said.

The gunman, identified by the sheriff as Juan Gonzales, in his 40s, of the Omak area, was also flown to Harborview. He was in serious condition with a gunshot wound to the torso.

The shooting happened shortly after 10 p.m. Wednesday in an alley behind the Stampede Motel.

A woman acquaintance of the suspect called police because he was trying to get into her room, Weed said.

The two officers arrived and confronted the man in the alley.

``He was agitated. The officers were trying to talk with him and find out what was going on and he had his hands in his pockets. They told him to pull his hands out of his pockets. He didn't,'' the sheriff said.

The man then pulled out a gun and shot one officer in the head, Weed said.

The other officer returned fire and the gunman went down. As that officer was trying to handcuff the suspect, the wounded man pulled out another gun from his other pocket and shot the officer in the left thigh, Weed said.

The wounded officer finished cuffing the suspect and then performed CPR on his partner, who was not breathing, until medics arrived.