November 26, 2019 | 2:08pm | Updated November 26, 2019 | 2:45pm

A Texas teacher who lost her job after asking President Trump on Twitter to remove the “illegal students from Mexico” from her school has won an appeal to get her job back.

Texas Education Agency Commissioner Mike Morath ruled Monday that the series of offensive tweets sent in May by Georgia Clark — an English teacher at Carter-Riverside High School in Fort Worth — were protected by the First Amendment, the Fort Worth Star-Telegram reports.

Clark, whose Twitter account has since been deleted, is now entitled to return to the classroom with back pay and employment benefits or district officials can fork over one year’s salary.

The teacher was fired in June after seeking assistance from Trump in a barrage of tweets that she said she thought were private messages to the commander-in-chief, Clark later told a district investigator.

“Mr. President, Fort Worth Independent School District is loaded with illegal students from Mexico,” one message sent on May 17 read. “Carter-Riverside High School has been taken over by them.”

In another tweet, Clark said her earlier attempts to “remove the illegals” were rebuffed by local and federal authorities in Fort Worth, where 34 percent of residents are Hispanic or Latino, census data shows.

School officials had argued that Clark waived her First Amendment rights by signing a contract with the district, an assertion that Morath ruled was erroneous.

Clark did not “waive her right to contact, outside of the workday” elected officials about topics in which they have jurisdiction, according to Morath’s ruling.

“But while teachers retain free speech rights, these rights are not unlimited,” Morath wrote.

Superintendent Kent Scribner said late Monday that the district stood by its decision to fire Clark, saying it was in the “best interest” of all students.

A spokeswoman for the district, meanwhile, characterized Morath’s decision as a technicality, adding that all options are now being explored.

“This is all we are going to say right now as we have not yet had a chance to review and analyze the entire decision,” spokeswoman Barbara Griffith told the newspaper.