The shooting deaths of two federal agents last week and three in two months highlight the heightened risk to federal investigators who are confronting increasingly violent fugitives, drug traffickers and other criminals, authorities said.

The killing of a U.S. Immigration and Customs Enforcement agent in Mexico on Tuesday was followed by the slaying of a deputy U.S. marshal in West Virginia on Wednesday, an unusual confluence of events that left officials deeply troubled. A Border Patrol agent was fatally shot in Arizona in December.

The killings, while not connected, come amid a broadening federal role in fighting violent crime that was once left mainly to state authorities, investigators said. Federal-state task forces on violent crime have multiplied since the Sept. 11, 2001, attacks, bringing federal agents in closer contact with dangerous criminals. And the government says it is pouring resources into fighting drug trafficking and other crimes along the border with Mexico.

"You're seeing feds playing a much more active role in fighting violent crime, and that's putting us in harm's way,'' said Jon Adler, president of the Federal Law Enforcement Officers Association. "We're getting a lot more dangerous people off the street, but the more you do, the more you are exposed.''

Overall, deaths of officers in the line of duty are rising nationwide. About 160 died in 2010, a nearly 40 percent increase from the year before, according to the D.C.-based National Law Enforcement Officers Memorial Fund. The organization, which tracks law enforcement deaths, said 61 officers were killed by gunfire in 2010, up from 40 in 2008.

The overwhelming majority of officers killed were state and local police, and deaths of federal agents have remained relatively stable, rising from six in 2009 to eight last year. Experts say that law enforcement death rates bounce up and down, with the most dangerous period in the 1970s.

"We have these blips. Policing is always dangerous business,'' said David Klinger, a criminologist at the University of Missouri at St. Louis. The close proximity of the recent deaths of federal agents was "very unusual," he said, adding: "This could be the leading edge of an explosion of violence. But we need to track it over time.''

Officials from several of the affected agencies say their agents face growing danger on the streets. Even as FBI statistics show a decrease in violent crime in recent years, federal criminal caseloads have risen steadily, and agents are more likely to encounter suspects who will attack them with guns and other weapons.

"It's much more violent than in the past,'' said Mike Earp, assistant director of investigations for the U.S. Marshals Service, which arrests fugitives and works with state and local law enforcement on regional fugitive task forces that target violent offenders. "Many more of these people are armed, and they have an utter disregard for human life.''

Deputy U.S. Marshal Derek Hotsinpiller, 24, fell victim to that violence when he and several other deputy marshals and local police officers arrived at the home of Charles E. Smith on Wednesday in Elkins, W.Va. The officers were serving an arrest warrant on Smith, who was wanted on federal drug and weapons charges.

After the officers broke down the door, shotgun blasts rang out, officials said. The gunfire killed Hotsinpiller and wounded two others - Alex Neville, a supervisory deputy U.S. marshal, and Fred Frederick, a deputy U.S. marshal - who are recovering from their injuries.

Deputies returned fire and Smith was killed, officials said.

Hotsinpiller's death has had an "indescribable" effect on the Marshals Service, Earp said. "He was one of ours. It makes everyone stop, think, reflect and hug their families,'' he said.

A day earlier, two Immigration and Customs Enforcement agents were shot by unknown assailants while driving between Mexico City and Monterrey, Mexico. The agents were returning to Mexico City from meetings with other U.S. personnel.

Special Agent Jaime Zapata, 32, died of his wounds. Special Agent Victor Avila Jr. was shot twice in the leg and is recovering.

"This is a difficult time for ICE,'' said John Morton, the agency's director. "This tragedy is a stark reminder of the risks confronted and the sacrifices made by our men and women every day.''

The governor of the Mexican state where the ambush occurred blamed drug cartel members.

Drug violence has killed more than 34,000 people in Mexico in the past four years. The departments of Justice and Homeland Security have established an FBI-led task force to work with Mexico in the investigation.

Drug-related violence along the Mexican border also may have played a role in the death of Border Patrol agent Brian A. Terry. He was gunned down Dec. 15 while tracking narcotics traffickers and searching for illegal immigrants near Rio Rico, Ariz.

The number of Border Patrol agents has doubled since 2004, and the danger they face when stopping potential illegal immigrants has increased "exponentially,'' said Mark Qualia, a spokesman for U.S. Customs and Border Protection.

"In the 1990s, you'd be catching migrant workers, average Joes coming here to seek jobs,'' he said. "There was very, very rarely any altercation.''

Now, Qualia said, agents are more likely to encounter people with outstanding warrants for drug trafficking and other crimes.

"They are much more desperate, and they have a tendency to be a lot more combative,'' he said.

Jerry Markon covers the Department of Homeland Security for the Post’s National Desk. He also serves as lead Web and newspaper writer for major breaking national news.

Comments our editors find particularly useful or relevant are displayed in Top Comments, as are comments by users with these badges: . Replies to those posts appear here, as well as posts by staff writers.

To pause and restart automatic updates, click "Live" or "Paused". If paused, you'll be notified of the number of additional comments that have come in.

Comments our editors find particularly useful or relevant are displayed in Top Comments, as are comments by users with these badges: . Replies to those posts appear here, as well as posts by staff writers.