Soldiers at Camp Nathan Smith, a U.S. base in Kandahar, Afghanistan, bow their heads at a memorial service for Army Specialist Brittany Gordon, an intelligence analyst who was killed in October in a suicide attack near the Pakistan border.

WASHINGTON — Marine Corps Pvt. Lazzaric T. Caldwell slit his wrists and spurred a legal debate that’s consuming the Pentagon, as well as the nation’s top military appeals court.

On Tuesday, the court wrestled with the wisdom of prosecuting Caldwell after his January 2010 suicide attempt. Though Caldwell pleaded guilty, he and his attorneys now question his original plea and the broader military law that makes “self-injury” a potential criminal offense.

The questions resonate amid what Pentagon leaders have called an “epidemic” of military suicides.

“If suicide is indeed the worst enemy the armed forces have,” Senior Judge Walter T. Cox III said, “then why should we criminalize it when it fails?”

For 40 minutes Tuesday morning, Cox and the four other members of the Court of Appeals for the Armed Forces sounded deeply ambivalent about the complexities involved in prosecuting members of the military who try to kill themselves. While several judges sounded skeptical about the government’s claim that Caldwell’s actions brought discredit to the Marine Corps, judges also sounded hesitant about ruling out prosecution altogether.

“I question whether it’s up to us to say that under no circumstance can someone be prosecuted,” Judge Scott W. Stucky said. “Isn’t that up to Congress?”

Congress and the White House might, in fact, get into the act.

Earlier this year, Defense Department General Counsel Jeh Johnson asked a Pentagon advisory committee to consider recommendations revising the Manual for Courts-Martial so that a “genuine attempt at suicide” may not require disciplinary action. The Joint Service Committee on Military Justice will make a suggestion eventually.

Everyone agrees there’s a problem.

Last year, the 301 known military suicides accounted for 20 percent of U.S. military deaths. From 2001 to August 2012, the U.S. military counted 2,676 suicides.

It’s also becoming more common among veterans. Though timely numbers are elusive, the Department of Veterans Affairs reported that 3,871 veterans who were enrolled in VA care killed themselves in 2008 and 2009.

Active-duty members of the military who succeed in killing themselves are treated as having died honorably. Active-duty members who try and fail may be prosecuted under the Uniform Code of Military Justice if the suicide attempt is deemed conduct that causes “prejudice to good order and discipline” or has a “tendency to bring the service into disrepute.”

“You don’t think people will think less well of the military if people are killing themselves?” Judge Margaret A. Ryan asked rhetorically.

The Marine Corps recorded 163 suicide attempts last year and 157 attempts so far this year, according to the service’s Suicide Prevention Program. Statistics for other branches weren’t immediately available. Prosecutions are infrequent, but they do occur.

Marine Corps Lance Cpl. Darren Evans faces murder charges in the death of his roommate at Camp Pendleton in California. Prosecutors also have charged Evans with self-injury because he subsequently threw himself from the third story of his barracks.

On the other hand, Medal of Honor recipient and Marine Corps veteran Dakota Meyer recounts in his 2012 memoir that he once put a gun to his head and pulled the trigger in a moment of post-combat distress. The gun wasn’t loaded, and Meyer was neither caught nor prosecuted.

Now a civilian resident of Oceanside, Calif., Caldwell was a 23-year-old Marine private in January 2010. He’d been diagnosed with depression and post-traumatic stress disorder after suffering through other personal problems. After Caldwell was told he was being sent to the brig over the alleged theft of a belt, he slit his wrists with a razor in the barracks at Camp Schwab, Okinawa.

“The public today views suicide attempts like this as an illness,” Caldwell’s appellate attorney, Navy Lt. Michael B. Hanzel, told judges Tuesday.

Caldwell eventually pleaded guilty to self-injury and received a bad conduct discharge after being convicted of larceny, driving without a license and possessing the drug known as “spice.”

“This case is not about prosecuting suicide or attempted suicide,” Marine Corps Maj. David N. Roberts said Tuesday. “It’s about prosecuting an act that was prejudicial to good order and discipline.”

Roberts conceded under questioning, though, that even the trial judge thought self-injury was an “odd charge” for military prosecutors to levy. Pressing the point, Chief Judge James E. Baker asked skeptically whether the military would charge someone who’d developed post-traumatic stress after five combat tours.

Hanzel suggested one potential solution: telling judges they could set a rule that once a reasonable case had been made that a suicide attempt was genuine, the burden would shift to the government to prove otherwise. It might require an additional policy change, from military and political leaders, to treat suicide attempts as something other than a crime.