(Reuters) - The American Civil Liberties Union on Monday said it filed a lawsuit in federal court to block a Mississippi law allowing people with religious objections to deny services to gay and transgender people.

The law is due to take effect in July. The ACLU said the measure is discriminatory and contradicts the U.S. Supreme Court's ruling last year that legalized same-sex marriage.

The ACLU is suing on behalf of Mississippi residents Nykolas Alford and Stephen Thomas, a gay couple engaged to be married.

"At a time when we’re supposed to be excited as a couple engaged to be married, this law permits discrimination against us simply because of who we are," they said in a statement released by the ACLU. "This is not the Mississippi we’re proud to call home."

Mississippi Governor Phil Bryant, a Republican, last month signed into law the wide-reaching measure that permits people with religious objections to deny wedding services to same-sex couples.

The law also clears the way for employers to cite religion in determining workplace policies on dress code, grooming and bathroom and locker access.

In its release, the ACLU said that Mississippi law could also impact nearly anyone in a sexual relationship outside of a heterosexual marriage. While the initial legal challenge is focused on same-sex couples, the organization said it would fight other provisions of the law if they go into effect.

(Reporting by Colleen Jenkins and Letitia Stein; Editing by Chizu Nomiyama and Tom Brown)