Two servicemen have told lawmakers that U.S. special forces called in an air strike on a hospital in Afghanistan because they thought the Taliban were using it as a command post, contradicting the military’s claim that the attack was meant for a different building.

The unnamed servicemen were quoted by Rep. Duncan Hunter, R-Calif., Tuesday in a letter he sent Tuesday to Defense Secretary Ash Carter. The letter highlights gaps in the military’s explanation of the October air strike on a Doctors Without Borders hospital in Kunduz that killed 31 civilians.

Hunter said the personal accounts raise the possibility that the U.S. was manipulated by its Afghan partners into attacking the hospital. If true, it would be a setback to U.S. efforts to work with and train a local militia capable of handling security efforts in the country.

Navy Capt. Jeff Davis, a Pentagon spokesman, said Carter had received the letter but the Defense Department wouldn’t comment on it. Hunter refused to name the servicemen because he said they feared disciplinary action.

The two servicemen told Hunter the U.S. special forces soldiers who called in the air strike were not aware the hospital was being used by the charity. Afghan forces, they say, told them it had become a Taliban command and control center.

"There were enemy in there," Hunter quotes one of the servicemen as saying. "They had already removed and ransomed the foreign doctors, and they had fired on partnered personnel from there."

Doctors Without Borders and other witnesses have repeatedly said there were no armed men in the hospital at the time of the airstrike. The military says the soldiers and airmen intended to hit a different building a half-mile away.

Gen. John Campbell said it was only because of technical failures and human error that an AC-130 mistakenly struck and destroyed the trauma center in the hospital.

Campbell said that when the aircraft's sensors malfunctioned, the crew used visual cues to hone in on what turned out to be the wrong building. One minute before the attack, he said, the crew passed on the coordinates of the building it was about to strike to its headquarters, which knew Doctors Without Borders was in that compound but was unable to detect the mistake in time.

Campbell did not say how the AC-130 got the coordinates of the hospital it was flying over, so it is unclear whether the crew used the plane's instruments to determine them or got the information from U.S. personnel on the ground, who were working with Afghans.

Campbell also did not say whether Afghan forces gave the coordinates of the hospital to the Americans. Afghan special forces had raided the hospital in July and disliked that the hospital treated Taliban.

According to the Associated Press, a senior special forces commander wrote a report saying the hospital was in the Taliban’s hands and even after the attack, senior Afghan officials insisted the air strike was justified because Taliban militants had been present.

Pentagon officials said they cannot discuss the case because of investigations pending into the culpability of individual service members, some of whom have been suspended from duty.

The military’s investigation has found that the rules of engagement were not followed, Campbell said. He acknowledged that no U.S. ground forces had a direct view of the hospital before the attack.

The Associated Press contributed to this report.