A police officer is gunned down in his patrol car in Penn Hills, Pa., while waiting for backup. Near Seattle, four officers starting their day at a coffee shop are ambushed by an ex-con with a handgun. Another four officers are shot to death in Oakland, Calif., after a traffic stop gone awry. Across the nation, 2009 was a particularly perilous year for officers involved in gun disputes.

The number of officers killed in the line of duty by gunfire increased 24 percent from 2008, according to preliminary statistics compiled by the National Law Enforcement Officers Memorial Fund, a national nonprofit organization that tracks officer-related deaths.

As of Saturday, 47 police officers have died nationwide this year after being shot while on duty, up from 38 for the same time in 2008, which was the lowest number of gunfire deaths since 1956, according to the data.

Over the past decade, small spikes in gunfire deaths have been common, but experts say they are surprised by the number of officers this year who have been specifically targeted by gunmen.

"There's an increasingly desperate population out there," said Eugene O'Donnell, a professor of police studies at the John Jay College of Criminal Justice in New York. "Other than in rare cases for ideological reasons, we really haven't seen people taking on the cops head-to-head. Something is amiss. It should be cause for grave concern."

Contributing to this year's spike are cases in which several officers were shot and killed in groups — the four officers last month outside Seattle; the four officers in Oakland, Calif., in March; three officers in Pittsburgh in April; and two officers in Okaloosa County, Fla., in April.

In the Nov. 29 shootings near Seattle, four Lakewood Police Department officers, all in uniform, were sitting with their laptops at a bustling coffee shop when shots rang out. Authorities said the gunman, Maurice Clemmons, spared employees and other customers. Clemmons was later shot to death in a confrontation with another officer, who wasn't harmed.

Clemmons had a violent, erratic past in Washington state and Arkansas. His 108-year prison sentence for armed robbery and other offenses was commuted by then-Arkansas Gov. Mike Huckabee in 2000. Six days before the shooting, he had posted bail on charges of raping a child.

In the April 4 shooting in Pittsburgh, suspect Richard Poplawski has been accused by prosecutors of ambushing the three officers when they responded to a domestic disturbance call. Wearing a bulletproof vest and armed with weapons including an AK-47 assault rifle, he started shooting almost immediately after they arrived, authorities said. Poplawski has pleaded not guilty.

In other cases, it's not so clear whether the officers were targeted, or just in the wrong place at the wrong time. Oakland officers Mark Dunakin and John Hege were shot and killed during a traffic stop March 21. The suspect fled and barricaded himself in a home, where two SWAT officers were later shot and killed as they tried to enter.

In Penn Hills, Officer Michael Crawshaw was buried Friday, about a week after police say he was gunned down by a parolee wearing an electronic monitoring bracelet on his ankle. Crawshaw was responding to a 911 call of shots fired and was waiting for backup when the suspect came out of the house and opened fire on his patrol car, police said.

The availability of guns compounds the problem, criminologists say. But Pennsylvania, the state with the most gun-related officer deaths so far this year, has among the strictest gun laws in the country, according to a ranking by the pro-gun-control Brady Campaign to Prevent Gun Violence. Other states, like Louisiana, Oklahoma and Kentucky, have very little oversight and had few, if any, officer gun deaths this year.

Kevin Morison, a spokesman for the Officers Memorial Fund, which keeps the statistics, said he sees people on both sides of the gun debate using the numbers to prove points.

"But folks who are willing to intentionally target police officers seem to be able to find a way to accrue guns regardless of what the laws in those state would be," Morison said.

Overall gunfire deaths have more or less been on a steady decline for decades as more tools become available to keep officers safe. More officers are required to wear bullet-resistant vests. There's also better and faster medical care to save an officer's life.

In 1973, during a heyday of corruption and crime, there were around 600,000 officers and about 156 gunfire deaths. Currently, there are about 900,000 law enforcement officers nationwide and only 47 gunfire deaths this year — a per-capita decrease of nearly 21 percent.

Despite the increase in the number of gunfire deaths from 2008, there have been fewer overall officer deaths so far this year: 117, compared with 125 last year, according to the statistics. The major reason is that traffic deaths are down 24 percent.

"The chances of being killed in the line of duty are lower than they have been in modern times," Morison said. "But no one is immune to the dangers of the job."