WASHINGTON — The Senate Armed Services Committee sided with the Joint Chiefs on sexual assault legislation Wednesday, gutting changes passed by a subcommittee on Tuesday that would have created an independent legal command to prosecute serious criminal offenses.

The committee voted 17 to 9 to approve compromise legislation that includes more safeguards to look over the shoulders of commanders when they handle sexual assault allegations and prosecution; creation of victims’ legal counsel to guide rape and assault victims through each step of the process; and new reporting requirements so that Congress and the public can more closely monitor how sexual assault cases are processed.

The provisions will be part of the committee’s version of the 2014 defense authorization bill.

But on the core question of whether the chain of command should be stripped of powers to decide which cases are prosecuted, the committee sided with military leaders who said it would interfere with the ability to command.

Sen. Carl Levin, D-Mich., the committee chairman who sponsored the compromise, said he agreed with the Joint Chiefs, who testified before the committee last week, saying a separate prosecution command could weaken response and lessen the chance of prosecution.

He insisted this is not meant to downplay the problem.

“We all know that we have a serious problem with sexual assault in the military,” Levin said. “We have a problem with the underreporting of sexual assaults. We have a problem with the inadequate investigation of sexual assaults. We have a problem with the lack of support for victims of sexual assaults. We have a problem with retaliation, ostracism and peer pressure against such victims. And we have a problem with a culture that has taken inadequate steps to correct this situation.”

Culture change, Levin said, is more likely to happen if commanders are involved in the prosecution of sex-related crimes than by creating a separate legal command.

“It is harder to hold someone responsible for failure to act if you reduce their power to act,” Levin said.

“The military has been far too behind on this,” said Rep. Kelly Ayotte, R-N.H., who also supported the compromise because she believes military commanders who improperly handle sexual assault cases will be fired as a result of the changes. “This is not something we are going to pass here today and forget about.”

Defense Secretary Chuck Hagel made exactly that point earlier in the day before the Senate Budget Committee. “I don’t personally believe you can eliminate the command structure in the military from this process,” he said. “It is the people within that institution that have to fix the problem, and that’s the culture. The people are the culture. So I don’t know how you disconnect that from the accountability of command.

“We need to change some things,” Hagel said. “We can do things much better; we’ll have to. But I think we’ve got to be very careful when we talk about taking the command structure out of this process.”

Sen. Kirsten Gillibrand, D-N.Y., who had championed creation of legal authority outside of the chain of command, said the military command structure has had a lot of time to fix this problem.

“The chain of command has told us for decades that they will solve this problem. They have failed,” said Gillibrand, who chairs the personnel panel that on Tuesday passed the legislation that would have created a separate legal command to handle serious crimes not involving military-unique charges.

“To reverse this crisis, I do not believe it would be enough,” she said of the Levin compromise.

Levin argued that the compromise strengthens current law. For example, if a commander decides not to prosecute a sexual assault case, the decision would automatically be reviewed by the next-higher commander, likely a flag or general officer. An even higher-level review, by a service secretary, would be required if a commander does not prosecute a case that his staff judge advocate recommends for prosecution.

Retaliation, or fear of retaliation, is a serious issue, Levin said, noting that the compromise would order the military to make this a criminal offense.

Gillibrand said she supports making retaliation a crime and having higher-level reviews but believes the “best environment” for rape and assault victims to come forward is one where they believe offenders will be prosecuted.

“I am just distressed the victims’ voices are not being heard in this debate,” she said. “Victims have said they are not reporting because it is within the chain of command.”

Taking the issue out of the chain of command could lead to more victims willing to come forward, Gillibrand said, noting only about 300 sexual assault cases go to trial each year although about 3,300 are reported. “A lot more are going to trial if you increase reporting,” she said.