In a blow to President Obama’s signature legislative mandate, a Brooklyn federal judge on Monday sided with several Catholic organizations in New York, saying they do not have to comply with an Affordable Care Act requirement to provide employees with contraceptive coverage.

Citing religious freedom grounds, the organizations filed the lawsuit last year seeking protection from the Obamacare directive.

In the first permanent ruling on the hot-button issue, US District Court Judge Brian Cogan said the religious groups should not be forced to comply with the birth control component of Obamacare.

The plaintiffs benefitting from the permanent injunction are Cardinal Spellman High School in the Bronx, Monsignor Farrell High School on Staten Island, the ArchCare healthcare group and Catholic Health Services of Long Island.

The Archdioceses of Rockville Centre and New York, which are also plaintiffs to the suit, are already exempt from the contraceptive care requirement as religious institutions. The law takes effect Jan. 1

The controversial Obamacare component has sparked a flurry of lawsuits from religious employers seeeking relief from the birth control mandate.

Cogan ruled the plaintiffs “demonstrated that the mandate, despite accommodation, compels them to perform acts that are contrary to their religion. And there can be no doubt that the coercive pressure here is substantial.”

“They consider this to be an endorsement of such coverage; to them, the self-certification compels affirmation of a repugnant belief,” Cogan wrote. “It is not for this Court to say otherwise.”

He also suggested that employees could be provided with contraception through alternate government programs without the involvement of their religious employer.