A government watchdog suggested that Congress might want to prohibit the Defense Department from spending money on Afghan military units whose members sexually abuse children or commit other human rights ­violations. But the Pentagon disagreed with that idea, saying such incidents must be weighed against U.S. national security interests.

The suggestion was made by the office of the U.S. Special Inspector General for Afghan Reconstruction (SIGAR) in a previously classified report released Tuesday. It highlights the challenges the U.S. military faces in partnering with forces abroad that do not always adhere to the same codes of conduct. U.S. troops have long complained that some Afghan commanders sexually abuse boys.

Ninety-three members of Congress requested that SIGAR investigate the issue after a 2015 New York Times report alleged that sexual abuse of children was “rampant” in Afghan units, putting U.S. troops in emotionally charged and challenging situations. The review focused on the implementation of the Leahy law, which restricts the U.S. government from assisting a foreign security unit found to be in gross violation of human rights.

The law allows for exceptions when the defense secretary determines that continuing support to a problematic unit meets a national security concern. SIGAR suggested that Congress might want to eliminate that exception, and the Pentagon balked when it viewed a draft of SIGAR’s report.

“The draft report does not fully convey the unique and difficult challenges of implementing the Leahy law in Afghanistan consistent with both the U.S. commitment to human rights and U.S. national security objectives in Afghanistan,” Jedidiah Royal, a Pentagon official, wrote in a May 2017 response included in the report. “In particular, the draft report does not reflect an understanding of the challenges faced by U.S. forces in Afghanistan in developing and sustaining the Afghan National Defense and Security Forces.”

The Pentagon resisted when lawmakers asked SIGAR to launch the investigation, an aide to Sen. Patrick J. Leahy (D-Vt.), the namesake of the Leahy law, told The Washington Post in November. The Defense Department argued that SIGAR did not have the jurisdiction to examine the issue, even though SIGAR has routinely dissected U.S. work in Afghanistan, said the aide, Tim Rieser.

A Defense Department inspector general report released in November concluded that U.S. troops have been inadequately trained to report sexual abuse in Afghanistan for years. The Pentagon watchdog made several recommendations, including building a central database of gross violations of human rights, and noted that the Defense Department has historically decided to withhold funding over human rights violations in Afghanistan about once a year.

However, the Pentagon report did not suggest that Congress consider eliminating the defense secretary’s ability to make exceptions to the Leahy law on the basis of U.S. national security.

The SIGAR report states that data provided by the Pentagon showed that as of Aug. 12, 2016, the Defense Department was tracking 75 gross human rights violation allegations. Seven involved child sexual assault, 46 involved other human rights violations and 22 were classified secret and weren’t discussed in the report. U.S. officials found one child-sex allegation to be credible, with five others under review, and one was determined not credible.

Although the Defense and State departments have taken steps to identify and investigate child-sex abuse in Afghanistan, the full extent of the problem may never be known, SIGAR found.

The Defense Department called the SIGAR report “speculative and not well-substantiated,” pointing out that investigators “only interviewed 16 service members during this review.”