WASHINGTON – Two senior military officers said for the first time Friday that they were “open” to proposed legislation that would overhaul military law in response to an epidemic of sexual assaults, acknowledging that victims lack faith in commanders to handle the problem.

Army Gen. Martin Dempsey, chairman of the Joint Chiefs of Staff, and Air Force Gen. Mark Welsh III, the service’s top commander, said they were willing to consider giving military prosecutors, instead of legally untrained commanders, the authority to decide whether to pursue sexual-assault investigations.

The Pentagon has resisted taking such power away from military commanders. Although neither Dempsey nor Welsh endorsed the proposal, their comments aligned them with Defense Secretary Chuck Hagel, who has said he is willing to discuss it with lawmakers.

With military leaders acknowledging that they are confronting a “crisis” of sexual assaults in the ranks, pressure is building in Congress to pass major legislation to address the issue.

A bipartisan group of lawmakers announced Thursday that they support a bill from Sen. Kirsten Gillibrand, D-N.Y., that would force the most significant changes in military law in 30 years by giving prosecutors, instead of unit commanders, the power to open investigations into serious crimes and send the cases to trial.

Some influential lawmakers on the House and Senate armed services committees remain cool to the idea, saying it is important to preserve commanders’ authority. But the proposal has gained momentum with a string of recent sex-crime scandals and other embarrassing disclosures.

In a news conference Friday, Welsh, the Air Force’s chief of staff, said “all options should be on the table” and that “I personally am open” to a plan that would give prosecutors the authority to pursue sexual-assault cases.

Ten days earlier, he testified before the Senate Armed Services Committee that he was opposed to the idea. “I feel very strongly that that’s in the commander’s purview for a reason,” he said.

On Friday, Welsh said that combatting sex crimes was his top priority and that he personally reviews each report of sexual assault in the service.