Four elite U.S. Special Operations troops charged in the death of a Green Beret soldier in Mali plotted to record him being sexually assaulted as part of a plan to embarrass him through hazing, according to one of the accused service members.

Marine Staff Sgt. Kevin Maxwell said in a written stipulation of facts submitted for the case that the plan included bursting into Army Staff Sgt. Logan Melgar’s bedroom in the capital city of Bamako with a sledgehammer, choking him until he fell unconscious, tying him up and recording the sexual assault on video. The service members involved had just returned from a night of drinking, he said.

Those statements in part match the testimony of Chief Special Warfare Operator Adam C. Matthews, a former member of the Navy’s SEAL Team 6, who pleaded guilty in the case last month.

But Maxwell, a Marine Raider who was in Bamako to assist the SEALs, also told authorities about the sexual assault plan, according to the stipulation. A copy of it was obtained by The Washington Post and verified with two sources who are familiar with the investigation. They did so on the condition of anonymity, citing the sensitivity of the matter.

The four service members charged in the case were joined in the room by a Malian security guard and a British man who had befriended the Americans, Maxwell told authorities. The security guard was to carry out the sexual assault, while the British national planned to record it on a cellphone, Maxwell wrote. Those accusations have not previously been disclosed.

Melgar, 34, was killed on June 4, 2017, in an attack that took place on his bed as Chief Special Warfare Operator Anthony DeDolph, another member of SEAL Team 6, applied a choke hold and the other service members attempted to restrict him with duct tape, prosecutors have said. The men sought to haze and assault Melgar after months of disagreements between him and DeDolph, according to military documents outlining the case and obtained by The Post.

Brian Bouffard, a civilian defense attorney for Maxwell, declined to discuss Maxwell’s stipulation of facts. But he said his client was friends with Melgar and intends to plead guilty at a court-martial Thursday at Naval Station Norfolk in Virginia to charges that include negligent homicide.

“They committed a prank on Melgar,” Bouffard said. “It was a stupid prank, and it was not the kind of prank you or I would want pulled on us. It went bad. Maxwell is eager to accept responsibility for his role in it.”

That same week, Maxwell and Melgar took a riverboat cruise with other friends, enjoying drinks together, according to investigative documents and Maxwell’s stipulation of facts.

Phillip Stackhouse, an attorney for DeDolph, said that he disagrees with the characterizations of the night from Matthews last month and Maxwell now. He declined to elaborate with one exception.

"We absolutely deny that there was any intent to sexually assault Melgar,” Stackhouse said.

Beth Baker, a Navy spokeswoman in Norfolk, declined to comment on the details in Maxwell’s stipulation of facts.

The maximum punishment for negligent homicide includes up to three years in prison, dishonorable discharge and demotion in rank to private, according to military sentencing guidelines. Maxwell also could face additional time for some of the other charges he faces.

Matthews, Maxwell, DeDolph and Marine Gunnery Sgt. Mario Madera-Rodriguez were charged with felony murder, involuntary manslaughter, conspiracy, obstruction of justice and hazing. The four men and witnesses who were with them in the hours before the attack joked about sexually assaulting Melgar, according to military documents obtained by The Post. But Maxwell’s stipulation of facts states that the defendants also intended to carry it out.

Matthews pleaded guilty May 16 to lesser charges that include conspiracy to commit assault, unlawful entry, obstruction of justice and violating a general order by committing hazing. DeDolph and Madera-Rodriguez still face court-martial.

Navy Capt. Michael J. Luken, the judge in Matthews’s case, sentenced him to one year in prison, a demotion in rank to special operator second class and a bad-conduct discharge, which will take away most of his medical benefits. Luken left open the possibility of a reduced the sentence if Matthews cooperates with authorities.

Maxwell, in his stipulation of facts, stated that DeDolph was the primary proponent of the plan. As Matthews did in court last month, Maxwell also said that before the assault, the men woke up Melgar’s team leader, Sgt. 1st Class James Morris, asked for permission to haze Melgar and received it. Morris has not been charged in the case, and could not immediately be reached to comment.

DeDolph and Madera-Rodriguez have not entered pleas.

Melgar was a member of 3rd Special Forces Group and had previously deployed to Afghanistan. In court last month, friends and family members described him as committed to the Army and deeply frustrated with the behavior of DeDolph and other SEALs in Mali.

In a victim impact statement, Melgar’s wife, Michelle, told the court last month that she did not care about the length of Matthews’s sentence as long as he was never in a position to commit a similar act again, and that no amount of time would bring her husband back. She also said she is sad that Matthews’s “reckless choices” cost him his career and her husband his life.

“You finally coming forward was the beginning of the end of this mess, and for that I am grateful,” she said. “This has been a nightmare that I would never wish on anyone. I have hurt enough for everyone, and I’m so very sorry that your family will now have to hurt in a similar way as I have. I sincerely hope you make better choices when your day of freedom comes.”