The Texas Supreme Court has overturned sanctions against William Brewer III, the confrontational Dallas lawyer who has made headlines representing the National Rifle Association during a period of unprecedented tumult.

The 7-to-1 decision by the court majority Friday overturned a lower-court finding that Brewer had acted in bad faith in a 2014 product liability case in which he was alleged to have attempted to taint the jury pool.

“The record bears no direct, or even circumstantial, evidence of bad faith,” the court ruled.

Brewer and his allies said the decision provides a powerful rejoinder to the original sanction.

“The opinion validates what we have believed all along — that Bill and our law firm acted ethically at all times,” said Michael J. Collins, a partner at Brewer, Attorneys & Counselors. “This outcome underscores our commitment to the highest of ethical standards.”

Longtime opponents who have tangled with Brewer in court called the decision misguided.

“I am totally disappointed in our Supreme Court,” said Ted Lyon, a personal-injury attorney in Dallas who was a party to the original complaint, which involved Brewer’s conduct in a wrongful-death liability suit against a pipe manufacturer.

Brewer is a top adviser to NRA chief executive Wayne LaPierre and helped set in motion a rancorous split within the powerful gun lobby, as The Washington Post reported last year. Several NRA veterans have accused Brewer, who has offices in Dallas and New York, of instigating the feud to protect his fees, which totaled $24 million in one 13-month period, according to internal documents.

Brewer rejected those arguments. His work has been vigorously defended by LaPierre, who has said that the lawyer’s bills were appropriate and that Brewer brought long-overdue scrutiny to the nonprofit group.

Brewer’s representation of the NRA had been complicated by the Texas sanction involving a 2014 suit against his then-client Titeflex, a pipe manufacturer whose product was alleged to have started a fatal house fire.

The state-court judge in that case, Ruben Reyes, found that Brewer’s firm hired pollsters to conduct a “push poll” that provided misleading information to people involved in the case, possibly tainting the trial.

“The court finds Mr. Brewer’s conduct disrespectful to the judicial system” and “inimical to a fair trial by an impartial jury,” Reyes ruled at the time, ordering Brewer to attend 10 hours of remedial ethics classes and pay a $130,000 fine.

Brewer appealed the decision, which was initially upheld.

In September 2018, Brewer was reprimanded by a federal judge in Virginia after he did not disclose the Texas court sanction to a federal court in Virginia as he represented the NRA in a lawsuit with an insurance broker.

Brewer told The Post last year that he believed he disclosed what was necessary, noting that the matter was under appeal at the time.

Brewer was first hired by the NRA in 2018 to help the organization counter a challenge by New York state officials to the legitimacy of the organization’s Carry Guard insurance, which provides coverage to firearms owners who shoot someone and claim self-defense.

From there, Brewer pressed to take on other matters, eventually recommending to LaPierre that he audit the group’s outside contracts.

The audit put Brewer in conflict with the NRA’s largest vendor, the advertising firm Ackerman McQueen, which was founded by Brewer’s father-in-law.

The NRA claimed in court that its longtime advertising consultant had attempted to defraud the nonprofit, allegations that Ackerman McQueen denied. Documents in the case have revealed lavish spending by the firm on LaPierre’s behalf — including hundreds of thousands of dollars for air travel and luxury clothing. The NRA said the spending was appropriate.