Washington (CNN) The Supreme Court on Wednesday gave a Marine Corps veteran who sought disability benefits for his service-related post-traumatic stress a second chance to prevail in a case that will impact the amount of power federal agencies have.

But lurking behind the case was a dispute over government agencies that some conservatives feel have become too powerful, upsetting the balance of power.

Writing for five of the nine justices, Justice Elena Kagan narrowed the circumstances in which courts will defer to an agency's interpretation of ambiguous language in its own regulations. But Kagan stopped short of overturning court precedent.

Kagan wrote that such deference "retains an important role in construing agency regulations," but she said it is "sometimes appropriate and sometimes not." She outlined "markers" for when courts should and should not defer.

Chief Justice John Roberts wrote an opinion concurring in the judgment outlining those markers.

"The underlying regulation must be genuinely ambiguous; the agency's interpretation must be reasonable and must reflect its authoritative, expertise-based, and fair and considered judgment; and the agency must take account of reliance interests and avoid unfair surprise," Roberts wrote.

Paul Hughes, a lawyer for Kisor, praised the ruling, saying, "Today's decision will significantly narrow agency authority." Hughes noted that the lower court had applied a "reflexive form of deference" to the agency that was not warranted.

Justice Neil Gorsuch, joined in full by Justice Clarence Thomas and in part by Justices Brett Kavanaugh and Samuel Alito, wrote to say they thought court precedent should have been "easy for the Court" to overturn. Gorsuch said that while the opinion manages to leave court precedent "maimed and enfeebled" the justices should have found the "nerve" to wipe it off the books.

"Although it's easy to get lost in the administrative law weeds of this case, the major headline here is that Chief Justice (John) Roberts declined to join the four other conservative justices in overruling prior precedent, and instead joined his more progressive colleagues in narrowing but not ditching the idea that courts should sometimes defer to how administrative agencies resolve ambiguities in their own regulations," said Steve Vladeck, CNN Supreme Court analyst and professor at the University of Texas School of Law.

"The chief justice wrote separately to suggest that there isn't that much daylight between the result the Court reached and the one the dissenters would have adopted, but lower courts may well disagree as cases like these go forward," he said.

Vladeck added that the Court "was unanimous in agreeing to send the case back to the Federal Circuit, but split as to what should happen thereafter."

"Five Justices still think there is some room for deference to the VA, although they're not sure whether such deference is warranted in this case. Four would have the lower courts resolve the issue without any deference to the VA," he said.

This story has been updated.