A judge has ruled that claims made by then-President Donald Trump about the outcome of the 2020 election are protected under presidential immunity.

Philadelphia County Court of Common Pleas Judge Michael Erdos ruled Monday that a state election worker could not sue Trump despite statements he made casting doubts about the outcome of the election in Pennsylvania, a state that went for him in 2016 but went for Joe Biden in 2020.

“Erdos said Trump’s immunity covered a tweet he issued and comments he made remotely from the White House during a Pennsylvania state Senate committee hearing in November 2020. The statements, made without evidence, claimed fraud in Pennsylvania’s election tabulations,” The Hill reported.

Erdos noted in his ruling: “Other legal proceedings may examine the propriety of his statements and actions while he was the President and whether, as the plaintiffs in this and other cases contend, it was this conduct which served as the actual threat to our democracy. But this case is not the proper place to do so. Here, Trump is entitled to Presidential immunity.”

James Savage, a voting machine supervisor in the 2020 election from Pennsylvania, filed two consolidated lawsuits against Donald Trump, Rudy Giuliani, two poll watchers, and others, claiming they conspired to defame him. Savage alleges that their statements resulted in death threats directed at him and caused him to suffer two heart attacks, The Hill added.

According to Erdos’ ruling, Trump has immunity for the tweet and remarks made at the state Senate hearing, as they were made while he was serving as president. However, the lawsuit also includes claims over a letter Trump wrote to the House Jan. 6 committee last October, which he is not immune from as it was written after he left office.

Erdos ruled that the two earlier statements were linked to his official duties, as he was speaking to the public on matters of public concern while serving as president.

“Here, then-President Trump’s Gettysburg remarks and his tweet were public,” Erdos wrote. “Moreover, the topic of these statements—claims from third parties and the President himself about irregularities in the Presidential election which on their face called into question the integrity of the election and whether now-President Joseph Biden had been duly elected—was undoubtedly a matter of great public concern.”

“We are pleased with the Court’s decision to honor the long-standing principle of Presidential Immunity,” Trump legal spokeswoman Alina Habba, who is an attorney, said in a statement.

“Today, the Court made it clear that it is well within the President’s discretion to address the integrity of our election without fear of liability,” she continued. “We expect that the rest of Mr. Savage’s claims will similarly be disposed of as they are without merit.”

Trump’s daughter-in-law, Lara Trump, defended his actions following the 2020 election during an interview Tuesday evening, saying that he did “what you would want a president to do.”

Lara was appearing on “Jesse Watters Primetime” with fellow network contributor Clay Travis just hours after the former president was charged with four felony counts related to allegations he fraudulently attempted to overturn his loss to Joe Biden.

She said that while working as a senior adviser to her father-in-law’s 2020 campaign, she told Watters that “multiple times a day” she and others “would continue to receive reports from across the country of people, sometimes in the form of affidavits, detailing very questionable, nefarious things they saw at different polling locations.”

“So we had a lot of questions about what happened in the 2020 election. Quite frankly, I don’t think we’ve ever had an election in the United States history that we’ve come out of having more questions than we did post-2020,” she continued.

“One of those people as well as a sitting president of the United States, my father-in-law Donald Trump, who did exactly what you would want a president to do,” she said. “He upheld and defended the Constitution of the United States by trying to ensure that we indeed had a free and fair election. That was his whole goal. That’s what he wanted to ensure was going on.”