MOSCOW, Idaho - A sniper sprayed dozens of bullets on a courthouse in an attack that left one dead and two wounded, then hid in a nearby church for several hours before police stormed in yesterday and found his body and another man's inside, police said.

The shooting began late Saturday, fatally wounding one officer and injuring another and a civilian, said David Duke, Moscow's assistant police chief. Duke said the attack was apparently an ambush, with the gunman firing into the Latah County Courthouse to lure people into his line of fire.

Around 6 a.m., three SWAT teams entered the First Presbyterian Church and found the two bodies on the main floor but not in the same room, Duke said. An assault rifle, ammunition and spent shells were found with one of the men, he said.

The presumed shooter died of what appeared to be a self-inflicted gunshot wound to the head, Duke said. His body was found in the church sanctuary, and the body of another man was found in the church office.

Authorities did not release either man's name, but the church's pastor, the Rev. Norman Fowler, identified the victim inside the church as Paul Bauer, a sexton believed to be in his 60s who lived at the church.

Duke identified the slain officer as Lee Newbill, who had served with the Moscow Police Department since March 2001 and was the first city officer ever killed in the line of duty.

The wounded officer, Latah County Sheriff's Deputy Brannon Jordon, was in serious condition with multiple gunshot wounds, Duke said.

Authorities did not release the name of the injured civilian, but said he lived in the neighborhood and had gone outside after hearing the gunshots.

Police had no information about the gunman's motive, Duke said.

Police said the gunman started shooting from a parking lot across from the Latah County Courthouse shortly after 11 p.m. Saturday. A hail of more than 30 bullets ripped through the county's emergency dispatch center, Duke said. Dispatchers were moved to a room in the jail area of the courthouse. Officers rushed out of the building.

"Whoever the shooter is wanted to draw people to the courthouse," Duke said. "When officers responded, he did open fire on them."

None of the officers who responded returned fire, Duke said.

Newbill was the first officer at the scene of the shooting and was hit around 11:35 p.m. Saturday. Jordon, a 17-year veteran, was shot shortly after midnight as he tried to seek cover behind a tree after pulling Newbill out of the line of fire, Duke said.

The civilian was shot later, Duke said.

"He was just shooting at anybody he could," Duke said.

Moscow, a community of about 20,000 people that is home to the University of Idaho, is 80 miles south of Spokane, Wash.