A federal judge in Manhattan ruled on Friday that the Metropolitan Transportation Authority violated the First Amendment rights of a pro-Israel group when it rejected an advertisement the group wanted to place on city buses on grounds that they contained demeaning language.

The group, the American Freedom Defense Initiative, had proposed an ad that said, “In any war between the civilized man and the savage, support the civilized man.”

Then, between two Stars of David, the ad said: “Support Israel. Defeat Jihad.”

The transportation authority said the ad violated its prohibition on ads that demeaned individuals or groups on the basis of race, color, religion, national origin and five other specific categories. The group was given the opportunity to revise the ad, but it refused, and claimed in a lawsuit that the agency’s “no demeaning” language restriction was unconstitutional.

The judge, Paul A. Engelmayer of Federal District Court, ruled that the rejected ad was “not only protected speech — it is core political speech,” expressing a “pro-Israel perspective on the Israeli/Palestinian conflict” and implicitly calling “for a pro-Israel U.S. foreign policy with regard to that conflict.”