Rep. Duncan Hunter admitted that he took a picture with a dead combatant during his time as a Marine.

The California Republican made the admission during his defense of a Navy SEAL charged with multiple war crimes, including killing a teenage fighter, at a town hall on Saturday in his San Diego-area district.

Hunter advocated for a pardon for Edward Gallagher, who has been charged with stabbing to death a teenage Islamic State fighter under his care in Iraq in 2017, shooting two civilians in Iraq and opening fire on crowds.

NAVY SEAL EDWARD GALLAGHER’S LAWYERS SAY MILITARY PROSECUTORS SPIED BY HIDING TRACKING SOFTWARE IN EMAILS

Prosecutors say Gallagher texted a photograph of himself next to the dead fighter and wrote that he “got him with my hunting knife.”

The Republican told his constituents that he also once posed for a photo next to a dead combatant but noted that he did not text it or post it to social media. His admission was first reported by the San Diego Union-Tribune.

He said “a lot of us have done the exact same thing,” referring to fellow service members in Iraq and Afghanistan.

"A lot of us have done the exact same thing." — Rep. Duncan Hunter

He then slammed the military justice system as “corrupt” and said it was run by lawyers and bureaucrats intent on pursuing “warfighters.”

Gallagher has pleaded not guilty to all the charges. Hunter’s office did not immediately respond to Fox News’ request for a comment.

WIFE OF NAVY SEAL EDDIE GALLAGHER SAYS MILITARY PROSECUTORS SHOULD BE INVESTIGATED OVER ‘CRIMINAL WRONGDOING’

The legal team of the Navy SEAL said disgruntled SEALs made the accusations because they wanted to get rid of a demanding platoon leader.

They also accused the prosecutors of impropriety, including tracking software in emails in an apparent attempt to find out who is leaking information to the media about the case.

President Trump and Republican lawmakers have been somewhat receptive to the idea of pardoning Gallagher, suggesting that he is an innocent war hero being unfairly prosecuted.

CLICK HERE TO GET THE FOX NEWS APP

Trump recently got him moved from the brig to better confinement in a military hospital with access to his lawyers and family.

The Associated Press contributed to this report.