There were four New York firefighters standing in southern Afghanistan, nearly 7,000 miles away from Manhattan, photographed during a favored pastime of those who work closely in difficult, dirty jobs: making fun of each other.

At the center of the 2012 photo is Capt. Christopher “Tripp” Zanetis, who at the time was a co-pilot in a crew responsible for evacuating wounded troops and recovering downed allied pilots. They were “busting each other’s chops,” the airman who photographed the group wrote at the time.

Behind Zanetis is the workhorse of the effort — an HH-60 Pave Hawk helicopter.

Zanetis, 37, was among the seven U.S. troops killed Thursday when a similar Pave Hawk crashed in the Iraqi town of Qaim near the Syrian border, The Post reported. The incident, which does not appear to be the result of enemy fire, is under investigation, U.S. officials said.

Christopher J. Raguso, 39, a New York City Fire Department lieutenant stationed in Queens, was also killed in the crash. He served 13 years in the department.

Zanetis was a 10-year department veteran, mostly recently working as a fire marshal, the FDNY said in a statement.

Zanetis and Raguso were part-time airmen with the 106th Rescue Wing of the New York Air National Guard, headquartered on Long Island.

Capt. Andreas B. O’Keeffe, 37, and Staff Sgt. Dashan J. Briggs, 30, also of the 106th, were among the dead, the Pentagon said in a statement on Saturday.

Also killed were Capt. Mark K. Weber, 29, of the 38th Rescue Squadron at Georgia’s Moody Air Force Base and two airmen from the Air Force Reserve’s 308th Rescue Squadron at Patrick Air Force Base in Florida, Master Sgt. William R. Posch, 36, and Staff Sgt. Carl P. Enis, 31.

The deaths of Zanetis and Raguso underscore the significant role of military reservists and veterans among first responders. A U.S. official familiar with Air Force rescue operations said intense teamwork and the occasional adrenaline shock feel similar to combat operations, making firefighting and paramedic careers a natural draw for some veterans.

The official also said small-unit camaraderie and the unified sense of mission are attractive for veterans who find themselves unmoored from purpose in their post-military life. The firehouse, operated according to a hierarchy of experience, with a constant routine and uniform sense of urgency, can appear somewhat similar to a fire base in combat or a naval ship at sea.

About 1,400 reservists and veterans serve in the FDNY, the department said, with 62 currently on orders worldwide.

“They are truly two of New York City’s bravest — running into danger to protect and defend others, both in New York City and in combat overseas,” New York Mayor Bill de Blasio said, referring to Zanetis and Raguso. Fire Commissioner Daniel A. Nigro added: “Lt. Raguso and Fire Marshal Zanetis bravely wore two uniforms in their extraordinary lives of service.”

Zanetis’s parents, John and Sarah Zanetis, told the New York Times that their son was a sophomore at New York University on Sept. 11, 2001. “I think that’s what made him become a New York City fireman,” they said in a joint interview.

Zanetis was on his third combat tour when he was killed in Iraq, they told the paper. They could not be reached by The Post for comment.

According to a New York Daily News story from 2012, Zanetis’s team of “smoke eaters” saved nearly 100 lives in a three-month span.

Previously, Zanetis took leave from the FDNY to pursue his law degree at Stanford University. He graduated last year and was a leader in the student veteran group there, said Benjamin Haas, an Army veteran who met Zanetis as a fellow student.

“He had a gregarious and infectious personality … he touched a lot of different communities,” Haas told The Post.

Haas said in 2016, upon learning a plaque bearing the names of Stanford law students killed in World War II was lost in a closet and later found, Zanetis urged campus officials to rededicate the bronze plaque as a memorial.

The names of 18 former students killed overseas was set into a boulder.

“I never anticipated he too would soon become among those ranks,” Haas said.

Zanetis’s fellow airman, Raguso, was well-known for his strong will and quick action since his 2005 assignment to a ladder company in Brooklyn.

Since then, he had been cited for bravery and saving lives six times as an individual or a member of a unit, the department said. He was promoted to lieutenant in 2016 and assigned to a Queens fire battalion.

He also volunteered with the Commack Fire Department. A Friday post by the department said Raguso “died while protecting our freedom” in a post showing his dual service: a firefighter dress uniform and an Air Force duty uniform splotched in camouflage. His wife could not be reached for comment.

In August, Raguso deployed with other airmen to Texas for search-and-rescue efforts during Hurricane Harvey, local media reported.

Christian P. Engeldrum, an Army National Guard soldier and firefighter killed in Baghdad in November 2004, had been the last New York firefighter to die during active military service, the department noted.

There are about 2,000 U.S. troops in Syria and about 5,000 in Iraq, according to statements from the Pentagon. The United States is winding down its long campaign against the Islamic State in both countries, but the militants retain pockets of influence in some parts of Syria, including along the Euphrates River.

Reservists and veterans continue to swell the ranks, at least at the FDNY.

In May 2014, amid a downsizing of the Army after combat operations in Iraq temporarily ended and missions in Afghanistan slowed, a class of 290 New York fire academy graduates gathered to become probationary firemen. Officials asked the veterans in the class to be recognized.

A hundred stood up.

Missy Ryan contributed to this report. This post has been updated.

Read more: