A Texas town is offering residents relief grants for damage sustained by Hurricane Harvey — but applicants must first promise not to boycott Israel.

A website for the city of Dickinson allows individuals and businesses to apply for grants from funds donated after the hurricane that dumped more than 50 inches of rain in some parts of the state. But clause 11 of the document mandates that applicants clearly state their political persuasion regarding Israel, an “egregious violation” of the First Amendment, according to the American Civil Liberties Union.

“By executing this Agreement below, the Applicant verifies that the Applicant: (1) does not boycott Israel; and (2) will not boycott Israel during the term of this Agreement,” the application reads.

Andre Segura, legal director for ACLU of Texas, blasted the grant aid condition as a violation of free speech and said the government cannot hinge relief funds on a promise to “refrain from protected” political speech.

“Dickinson’s requirement is an egregious violation of the First Amendment, reminiscent of McCarthy-era loyalty oaths requiring Americans to disavow membership in the Communist party and other forms of ‘subversive’ activity,” Segura said in a statement.

ACLU officials said the city is apparently enforcing a law passed in May by Texas Gov. Greg Abbott that bans all state agencies from contracting with companies that boycott Israel.

“As Israel’s number one trading partner in the United States, Texas is proud to reaffirm its support for the people of Israel and we will continue to build on our historic partnership,” Abbott said in a statement. “Anti-Israel politics are anti-Texas policies, and we will not tolerate such actions against an important ally.”

David Olson, Dickinson’s city attorney, said Friday that he’s obligated by state law to put the controversial clause in the application until he’s told otherwise.

“The city is obviously concerned about this issue, but we’re kind of stuck between a rock and a hard place,” Olson told The Post in a brief telephone interview. “We recognize the issue and the city does not take a political stance either way. We, in fact, expressed our concerns when we adopted the clause initially.”

Olson said city officials don’t want to “jeopardize the ability” of being able to participate in the relief program.

“So we’re trying to just do what’s right and uphold the law, but we do recognize the issue,” Olson continued. “We’re just trying to follow state law.”

Randy Kallinen, a Houston-based civil rights attorney, told the station that the clause plainly “requires people to have a certain political expression” in order to receive governmental assistance.

“Conditioning the much-needed relief from Harvey and other disasters upon adopting a certain political position is really something that is very distracting and slows down the process of rebuilding after Harvey,” Kallinen told the station.

Meanwhile, people in Dickinson, a city of about 18,000 in Galveston County, are still reeling from the destruction left behind by Hurricane Harvey.

“We are actively seeking alternative places to live because we have been told it will be at least six months before the place is to where we can get back into the house,” resident Georgeanna Santarelli told the Galveston County Daily News. “The mold is bad — it looks like chalk. The animals are getting sick and we feel bad, getting headaches and puking.”