Elliott Broidy, seen in 2008, was a top fundraiser for President Trump. (David Karp/AP)

A federal judge has dismissed a lawsuit brought by a prominent Republican fundraiser alleging the Qatari government orchestrated the hacking of his emails, saying the sovereign nation could not be sued for an overseas cyberattack.

Elliott Broidy, a longtime supporter of President Trump and a former Republican National Committee deputy finance chairman, sued the Persian Gulf state in March, alleging its government directed the hack and, through U.S.-based lobbyists, leaked stolen and forged material to journalists in an effort to smear him.

Broidy has alleged that Qatar is a state sponsor of terrorism and sought to influence policymakers’ views on the matter. The Qatari government in March said Broidy’s lawsuit was “without fact or merit” and called it “a transparent attempt to divert attention from U.S. media reports about his activities.”

Broidy has been the subject of news stories that explored his and others’ alleged efforts to exploit their access to Trump to affect U.S. foreign policy and peddle influence to further their business interests. Those reports relied in part on the hacked emails.

U.S. District Judge John F. Walter in the Central District of California said in his ruling Wednesday that Broidy’s claim was premised on hacking “from outside the United States,’’ which meant that under the Foreign Sovereign Immunities Act, Qatar was immune from being sued.

In a footnote, however, Walter stated that given “the growing prevalence of attacks in cyberspace, it may be an appropriate time for Congress to consider a cyberattack exception” to the FSIA. which, he noted, “effectively precludes civil suits in United States courts against foreign governments or entities acting on their behalf in the cyberworld

“Without a change to the law, our nation’s adversaries throughout the world will follow the example here to target those who oppose their anti-American agendas,” Broidy said in a statement.

Broidy amended his lawsuit to include other defendants whose cases are still pending. They include a former business partner, a Qatari diplomat, a former United Nations official and the brother of Qatar’s emir, all of whom, Broidy alleges, were part of a hacking and disinformation campaign against him.