A conservative nonprofit organization must hand over the names of its top contributors to the California attorney general, a federal appeals court ruled Tuesday in a legal blow for the group's founders, brothers Charles and David Koch.

A three-judge panel for the U.S. Court of Appeals for the Ninth Circuit unanimously sided against the Americans for Prosperity Foundation in its challenge to the California attorney general's disclosure requirement, collecting the names and addresses of the largest donors to the group. The nonprofit—which was founded in 2004 and has tea party ties—along with a number of other groups, had claimed the requirement burdened their First Amendment right to free association by deterring possible contributors.

U.S. District Judge Manuel Real of the Central District of California issued a permanent injunction in 2016, blocking the state from demanding that information.

The panel vacated the trial court's injunction Tuesday, finding the attorney general had a state interest in collecting the information to prevent charitable fraud, and would not make the information public, with few exceptions.

“We hold that the California attorney general's Schedule B requirement, which obligates charities to submit the very information they already file each year with the IRS, survives exacting scrutiny as applied to the plaintiffs because it is substantially related to an important state interest in policing charitable fraud,” said the 41-page opinion, written by Judge Raymond Fisher.

Fisher was joined by Judges Richard Paez and Jacqueline Nguyen.

In their ruling, the judges said the state only collected donor information for nonpublic use.

“The risk of inadvertent disclosure of any Schedule B information in the future is small, and the risk of inadvertent disclosure of the plaintiffs' Schedule B information in particular is smaller still. To the extent the district court found otherwise, that finding was clearly erroneous,” the panel said.

In a statement, a spokesman for the Americans for Prosperity Foundation said they would seek further review.

“We are disappointed by the Ninth Circuit's latest decision and believe it imperils people's First Amendment right to freedom of speech and of association,” the statement said. “Consistent with the protected, sensitive nature of our donors' identities, the threat and chill they face from disclosure that was established during the trial of this case, and a demonstrated pattern of misuse of Schedule B information by California officials, the foundation intends to continue doing all it can to champion and protect the important constitutional rights at stake.”

“We remain gratified by the outpouring of amicus support from groups across the spectrum and hope these and other groups will continue to express their views in court as we seek further review,” it added.

Xavier Becerra, California's attorney general, weighed in Tuesday: “By law, California requires the collection of major donor information. The reason is simple: our mission is to protect Californians who donate their hard-earned dollars to charity. Charities operating in California must not engage in fraud or unfair business practices,” Becerra said in a statement.

The Thomas More Law Center, a Michigan-based group that says on its website it “defends and promotes America's Judeo-Christian heritage and moral values,” also lost its challenge to California's donor disclosure rule Tuesday.

Quinn Emanuel Urquhart & Sullivan represented the Americans For Prosperity Foundation before the Ninth Circuit, with Washington D.C.-based partner Derek Shaffer arguing on behalf of the plaintiffs.