Updated

The Air Force has decided three Air Force pilots were telling the truth when they said it was Miley Cyrus – and not drug-dealing – that inspired some off-color text messages that caused their reprimand and grounding in October.

An Air Force spokeswoman confirmed to FoxNews.com on Thursday that the pilots have been reinstated. The decision ends a tense dispute between members of Congress who championed the pilots’ case and officials at Texas’ Laughlin Air Force Base where the pilots are stationed.

Lawmakers had described their punishment as excessive and misguided, and praised the Air Force decision this week.

“Overall, we are content with the outcome and commend the Air Force for doing the right thing,” Reps. Duncan Hunter, R-Calif., and Rep. Adam Kinzinger, R-Ill., said in a statement.

The pilots, who have not been publicly identified, got in trouble after officials on base reportedly concluded they were distributing drugs based on text messages they sent to one another that included references to “Molly,” the street name for the drug ecstasy.

The pilots, who passed all their drug tests, explained to officials they were merely referencing lyrics in Cyrus’ hit, “We Can’t Stop,” which includes the verse, “We like to party/ dancing with Molly/ Doing whatever we want.”

The pilots were using their personal cell phones at the time.

The case also was probed by the Air Force inspector general at the urging of Air Force Chief of Staff Gen. Mark Welsh. At the time, the Air Force released a statement saying “commanders are expected to hold members accountable for their actions, while ensuring due process and equitable treatment are appropriately applied in every case.”

But lawmakers said the punishments were “excessive” -- especially since they were based only on text messages.

“At no point did investigators obtain any evidence beyond the initial text messages to support an allegation of illicit drug use,” Kinzinger, an Air Force veteran, and Hunter, a Marine Corps veteran, said in a Sept. 15. letter to Welsh.

The two were satisfied with the outcome this week, but warned the Air Force command may have overstepped.

“We do remain concerned, however, with the parts of the military justice system that seem to permit the unjustified seizure and misrepresentation of personal text messages — and we intend to address this issue. It’s important that this doesn’t happen again,” the lawmakers said.

The Air Force said in a Wednesday release that Commander Lt. Gen. Darryl Roberson decided the suspected drug-dealing "was not substantiated by the evidence," and the pilots' wings were returned. In a separate matter, two of the pilots are still under scrutiny for "unprofessional relationships, obstruction of justice and conduct unbecoming an officer."

“It is critical that we maintain standards of professional behavior in a training environment,” said Roberson. “Notwithstanding the determinations regarding drug use, the reviews made clear that acceptable standards of conduct were not always maintained. We demand all Airmen serve with integrity and professionalism and hold Airmen whose actions fall short of Air Force standards fully accountable.”