In a stark reminder of how dangerous working for Uncle Sam can be, 13 federal law enforcement officers died in 2011. Then the new year began with the murder of an officer in an otherwise peaceful park.

Margaret Anderson, a ranger with the National Park Service, was gunned down in Washington state’s Mount Rainier National Park on New Year’s Day.

The day before, John Capano, an agent with the Bureau of Alcohol, Tobacco, Firearms and Explosives agent, was killed in Seaford, N.Y., as he tried to stop a pharmacy thief. Capano, 51, who was off-duty at the time, apparently was mistakenly shot by another law enforcement officer, according to the Associated Press and New York media reports.

Last Thursday, Daniel Knapp, a 43-year-old FBI agent, drowned in Puerto Rico while trying to assist a distressed swimmer.

A day earlier, U.S. Park Police Sgt. Mike Boehm was buried. Boehm suffered a heart attack while on duty Dec. 16, trying to assist a man who plummeted from the Key Bridge in Georgetown.

Kevin Bacher, a ranger who served with Anderson at Mount Rainier, said she “always had a smile and always had a kind word and would bend over backward if you needed something.”

Anderson, a 34-year-old mother of two girls who was married to another ranger, probably would have been more than willing to assist even the likes of Benjamin Colton Barnes. But the 24-year-old Iraq war veteran allegedly shot her before she could even get out of her car. He then fled into the woods, where he developed hypothermia and drowned in a creek.

Before transferring to Mount Rainier in 2008, Anderson was assigned to the Chesapeake and Ohio Canal National Historical Park in Hagerstown.

“When I think of Margaret’s tenure here, I think of her big smile. But she also was a no-nonsense law enforcement officer,” said Kevin Brandt, the park’s superintendent. Unlike many officers, she became an emergency medical technician “to provide that important service to visitors,” he added. “She had a real love of nature. . . . She was a consummate ranger. She was everything that you’d want a ranger to be.”

Anderson’s death points to the perils that rangers face. “This tragedy serves as a reminder of the risks undertaken by the men and women of the National Park Service and law enforcement officers across the Department every day,” said Interior Secretary Ken Salazar.

Rangers are far more than park tour guides in peculiar hats. Particularly in remote parks, they carry out a variety of critical duties, including fighting fires, saving lives and being the cops many of them are authorized to be. There are two types of rangers, those with law enforcement powers such as Anderson, and interpretive rangers who have some of the same responsibilities but don’t carry guns, wear body armor or confront killers.

Generally, guns and bulletproof vests are not necessary, because national parks are safe places. “Margaret Anderson’s case was incredibly tragic for us, but it was very rare at the same time,” said National Park Service Director Jon Jarvis.

Like Anderson, many park service employees have a strong sense of mission and devote their careers to protecting America’s natural resources. “The Park Service . . . is a big family,” said Jarvis, himself a 35-year Park Service veteran. “To lose one of the family is devastating to us.”

While its people are devastated, he said, the Park Service “also will evaluate the situation in extraordinary detail to see if there is anything we can do to prevent this from happening in the future.”

The 13 officers who died in the line of duty, including deaths from job-related illness and accidents, compares with just four in 2000 and 17 in 2007, according to the Officer Down Memorial Page, a nonprofit organization. “These officers selflessly put themselves in harm’s way to protect their fellow Americans,” said Office of Personnel Management Director John Berry. “All Americans are saddened by their loss, and grateful for the courage every Federal law enforcement officer shows daily as they keep our nation safe.”

For all of the sadness the deaths bring, the killings of officers also generate understandable anger. When Jaime J. Zapata, an Immigration and Customs Enforcement (ICE) agent, was killed in Mexico in February, Homeland Security Secretary Janet Napolitano did not mince words:

“Let me be clear: Any act of violence against our ICE personnel — or any DHS personnel — is an attack against all those who serve our nation and put their lives at risk for our safety.”