Capt. Mathew L. Golsteyn was leading a Special Forces team in Afghanistan in 2010 when an 80-man mission he assembled to hunt insurgent snipers went awry. One of the unit’s five vehicles sank in mud, a gunshot incapacitated an Afghan soldier fighting alongside the Americans, and insurgents maneuvered on them to rake the soggy fields with machine-gun fire.

Golsteyn, already a decorated Green Beret officer, responded with calm resolve and braved enemy fire repeatedly that day, according to an Army summary of his actions. He received the Silver Star for valor for his actions during a 2011 ceremony at Fort Bragg, N.C. Top Army officials later approved him for an upgrade to the prestigious Distinguished Service Cross, second only to the Medal of Honor in recognizing combat heroism by U.S. soldiers.

In a rare reversal, however, Golsteyn, now a major, no longer has either award. The officer, a former member of the 3rd Special Forces Group and graduate of the U.S. Military Academy at West Point, N.Y., was later investigated for an undisclosed violation of the military’s rules of engagement in combat for killing a known enemy fighter and bomb maker, according to officials familiar with the case. The investigation closed last year without Golsteyn’s being charged with a crime, but Army Secretary John M. McHugh decided not only to deny Golsteyn the Distinguished Service Cross, but also to revoke his Silver Star.

McHugh cited a provision in Army regulations that if facts become known that would have prevented the awarding of a medal, the award can be revoked. The Silver Star was approved by a top commander in Afghanistan — Army Gen. David M. Rodriguez, then the three-star deputy commander of U.S. Forces in Afghanistan — according to Golsteyn’s lawyer, Phil Stackhouse.

“I firmly believe that had he known about the derogatory information that was [found] by the aforementioned investigation, he would have never awarded Major Golsteyn the Silver Star,” McHugh said in a Nov. 17 letter to Rep. Duncan D. Hunter (R.-Calif.), who has advocated on Golsteyn’s behalf. “Accordingly, I have decided to revoke the interim Silver Star that Major Golsteyn received for this action.”

The decision is still shrouded in mystery because of the secretive nature of the Army’s investigation into Golsteyn, who did extensive work with U.S. Marines in and around Marja in Helmand province. An online Defense Department database of top valor awards still included Golsteyn’s Silver Star as of Wednesday afternoon and said the information was current as of Jan. 30.

A spokesman for McHugh’s office, Lt. Col. Chris Kasker, declined to comment Wednesday, citing the administrative nature of the decision. But he released details of Golsteyn’s service record that show he no longer has a Silver Star and is is not in Special Forces anymore. The major earned a Bronze Star and Army Commendation medal with “V” devices for heroism in earlier actions, Kasker said. Golsteyn joined the Army in 2002.

Hunter, a former Marine officer and veteran of the wars in Iraq and Afghanistan, alleged in the Daily Beast on Tuesday that the Army “went to extraordinary lengths to investigate Golsteyn,” threatening his fellow soldiers and offering them immunity. In a Dec. 4 letter to Army Human Resources Command, Hunter said the revocation appears to be “retaliatory and vindictive.”

“The Army has been unable to present substantive evidence while an overwhelming number of first-person accounts provided to Army investigators uphold Matt’s record as a top-level operator,” said Hunter’s letter, which the congressman’s office released to The Post.

Golsteyn’s lawyer said the investigation into the Army officer’s actions was launched in 2011, less than a year after he received the Silver Star. He remains assigned to Army Special Forces Command at Fort Bragg and is in the process of determining what to do with his future, Stackhouse said. The lawyer declined to elaborate on what the Army investigated.

“In the summer of 2014, we were certainly under the impression that everything was done and complete,” said Stackhouse. “The revocation of his valor awards came out of left field to us.”

The decision also raises the question of whether the military should strip troops of awards they have earned if they are found to have done something wrong later.

Golsteyn’s Silver Star came for actions on Feb. 20, 2010. He assembled his unit after his base had come under sniper fire from an insurgent wielding a Dragunov rifle, according to an Army narrative of his actions. He directed his troops to launch an assault across 700 meters of open fields, but an armored truck known as a Mine Resistant Ambush Protected (MRAP) vehicle sank into mud under gunfire after about 175 meters.

Under heavy machine-gun and sniper fire, Golsteyn ran about 150 meters to the trapped MRAP to retrieve a powerful 84mm Carl Gustav recoilless rifle, an anti-tank weapon. While moving under gunfire, he coordinated a medical evacuation for the wounded Afghan soldier and then opened fire with the Carl Gustav, said the Army narrative, which was obtained by The Post.

“Captain Golsteyn was alone running in the open through enemy gun fire that had over 80 men pinned down, and from the crow’s nest on top of [Forward Operating Base] McQueary, it looked like Captain Golsteyn was alone fighting 30 enemy fighters out in the poppy fields,” the award narrative said.

Enemy reinforcements continued to arrive on the battlefield, so Golsteyn organized airstrikes by both F/A-18 Hornet fighter jets and a Predator drone. No American or coalition troops were killed in the battle despite a barrage of enemy fire that lasted four hours, the narrative said.

Golsteyn has been critical of the Afghanistan mission in the past. In the 2011 Bing West book “The Wrong War: Grit, Strategy  and the Way Out of Afghanistan,” he is quoted as saying that the Americans were considered insurgents in Afghanistan who were “selling a poor product called the Kabul government.”

West later wrote in a review of a book about another Special Forces soldier, Maj. Jim Gant, that the careers of Gant, Golsteyn and a third Green Beret, Dan McKone, were “terminated,” assessing that the Army failed them. West could not be reached for comment Wednesday.

Golsteyn wrote about his assignment in Afghanistan in a June 2014 academic paper for a class at Fayetteville State University that was published online. It covers his 2010 deployment and said that his unit — known as a Special Forces Operational Detachment Alpha, or A-Team — operated in multiple two- and three-man teams. Over time, local tribesmen grew to trust them, especially after three weeks of fighting, he added.

“We enjoyed repeated interactions with the local populace because we lived with them, fighting for them as well as alongside them,” Golsteyn wrote. “In a 60 day period, our medical clinic run by Green Berets with several Marine medics treated approximately 1,000 local Afghans. We executed multiple helicopter casualty evacuations for civilian victims of [improvised explosive devices] in addition to being the first responders to the scene in nearly every case.”

This story has been updated with new information about Golsteyn’s current status in the Army.