Alabama GOP Senate candidate Roy Moore attacked Rep. Ilhan Omar on Twitter Wednesday — telling her to “go back to Somalia from whence she came” — after she referred to him in a tweet as a “child molester.”

“President Trump was right,” said the controversial former judge. “She should go back.”

Moore, 72, appeared to be responding to a tweet that Omar (D-Minn.) sent out Tuesday about Alabama’s Republican Party launching an effort to seek her expulsion from the House of Representatives.

“Sorry [Alabama GOP], but this is a representative democracy,” Omar tweeted. “I was elected with 78% of the vote by the people of Minnesota’s 5th District, not the Alabama Republican Party. If you want to clean up politics, maybe don’t nominate an accused child molester as your Senate candidate?”

Alabama GOP leaders passed a resolution last weekend — calling for Omar’s removal and citing comments she made recently about Israel, which got condemned by lawmakers on both sides of the aisle.

“Rep. Omar has engaged in rhetoric that explicitly runs counter to American values and patriotism,” the resolution said. “The Alabama Republican Party urges its elected congressional delegation to proceed with the expulsion process in accordance to Article 1, Section 5 of the U.S. Constitution to expel Rep. Ilhan Omar from the United States House of Representatives.”

Moore’s “go back to Somalia” tweet was one of four posts that the former chief justice made on Wednesday in response to Omar’s comments. He referred to the freshman congresswoman as a “sworn enemy of Israel” in another — as well as an “avowed Muslim.”

“While in Congress she has been accused of numerous sexual relationships,” Moore tweeted. “I have been married to my wife, Kayla, since Omar was three and fought for my Country in Vietnam over 10 years before O was born. I fully support the resolution of the Alabama Republican Party asking Congress to expel Omar under Article 1 Section 5 of the US Constitution, I was sworn to defend after my graduation from the United States Military Academy at West Point.”

Moore’s “President Trump was right” comment was in reference to a tweet that Trump sent out in July, telling Omar and Democratic Reps. Alexandria Ocasio-Cortez, Rashida Tlaib and Ayanna Pressley — known collectively as “the Squad” — to “go back” to their countries to fix their governments.

Only one of the four lawmakers — Omar — is foreign-born, while the others all hail from the US.

Trump’s statement was later condemned by a House resolution. It wound up sparking chants of “send her back” at one of the president’s rallies in North Carolina, which led to calls for tighter security and reports of death threats.

While Moore is a fan of Trump, the president has said that it would be “devastating” if the senior Republican ran again next year following his failed bid in 2017 against Democrat Doug Jones.

Moore got hammered with sexual misconduct accusations — including claims he had a relationship with a 17-year-old when he was in his 30s — before the election and has largely remained out of the public eye.

“Republicans cannot allow themselves to again lose the Senate seat in the Great State of Alabama,” Trump tweeted back in May. “I have NOTHING against Roy Moore, and unlike many other Republican leaders, wanted him to win. But he didn’t, and probably won’t.”

In response, Moore took to Twitter and said: “Ever wonder why the mere mention of my name scares the ‘hell’ out of the Washington DC establishment, liberals, and LGBT? Like Pres Trump I want to see America great again,” Moore said. “But that is a job only God can do!”

There are currently three Republicans who’ve declared their candidacies in Alabama, including former Auburn University football coach Tommy Tuberville. Senate Majority Leader Mitch McConnell has said that the GOP party would be “opposing Roy Moore vigorously.”