The U.S. battle over bathrooms and wedding cakes is pushing many African-American leaders in the South to the forefront of the latest civil rights frontier, as the threat of discrimination overshadows long-held reservations on gay issues.

In Mississippi, black legislators have led calls to repeal their state's newly adopted law permitting those with religious objections to deny wedding services to same-sex couples and impose dress and bathroom limits on transgender residents.

The president of the National Association for the Advancement of Colored People (NAACP) in Mississippi is a plaintiff in a lawsuit seeking to block the measure from taking effect on July 1. A federal judge was to hear testimony in the case on Thursday.

In North Carolina, dozens have been arrested at statehouse rallies organized by a diverse coalition led by the state NAACP conference to protest a new law barring transgender people from using the bathrooms of their choice.

"Here we are again, facing discrimination towards a group of people," said Sonya Williams Barnes, a Mississippi black lawmaker who opposed the measure and fears that her race could be the next target. "Who knows where that is going to lead to."

Just four years after President Barack Obama rocked the religious black community by supporting gay marriage, black leaders are becoming some of the most forceful allies in the fight against a recent wave of legislation seen as harmful to lesbians, gays, bisexuals and transgender (LGBT) people.

U.S. President Barack Obama delivers a statement after the U.S. Supreme Court ruled that same-sex couples have a constitutional right to marry nationwide, in the Rose Garden of the White House, on June 26, 2015 in Washington, D.C. Drew Angerer-Pool / Getty Images

Opposition to same-sex marriage has long offered common ground to white conservative Republicans and religious African-Americans otherwise more liberal in their political views, but the battle lines are being redrawn, said Robert P. Jones, CEO of the non-partisan Public Religion Research Institute.

The new wave of anti-LGBT measures is forcing many to come to terms with contrasting views: Blacks who disapprove of homosexuality who also strongly reject anti-gay discrimination.

"The experience of discrimination among non-white Americans really does kick in," he said.

His research group's poll of 42,000 Americans last year showed that about half of blacks nationally oppose same-sex marriage, more than any other racial and ethnic group. In Mississippi, where Williams Barnes chairs the legislative black caucus, nearly seven in 10 blacks disapprove, the survey found.

RELATED: LGBTQ White House Staff Reflect on Two Terms of Change

But it also found that two-thirds of blacks polled nationally objected to allowing small business owners to refuse services to LGBT people on religious grounds.

"We know what it's like once you allow racism and hatred to be codified and to be written into the law," said Reverend William Barber II, president of the NAACP in North Carolina.

The Morning Rundown Get a head start on the morning's top stories. This site is protected by recaptcha

LGBT or Civil Rights?

Still, the topic remains polarizing. At North Carolina's capitol last month, several dozen mostly black preachers protested the comparison of the transgender bathroom fight to the 1960s civil rights movement against racial segregation.

"It is not a civil rights issue," said Reverend Bill Owens, founder and president of the Coalition of African American Pastors, who represents 7,700 church leaders nationally.

"I don’t want my daughter in the restroom with a man. I don’t want my wife in the restroom with a man," he added in a phone interview. "It is sick."

"They see it not just as a LGBT issue but as a Pandora's box being opened back up to allow discrimination."

Other African-Americans have a different view. They see these new laws as not just bad for the LGBT community, but also harmful to all minority workers.

North Carolina's new law prevents cities from requiring private businesses to pay workers a minimum wage above the state level and makes it harder to sue over workplace discrimination.

Mississippi's law is so broad, critics say it could allow people with religious objections to deny services to nearly anyone in a relationship outside of heterosexual marriage, including single mothers, as well as restrict bathroom access for transgender people.

Both laws were passed at a time of a deepening partisan divide in southern legislatures, where white, Republican majorities can often pass laws without the votes of black Democrats.

RELATED: Judge Refuses to Block Mississippi Anti-LGBT law

In North Carolina, Democratic state senators staged a walkout to protest the bathroom legislation during a one-day special session in March. The bill cleared the chamber unanimously and was signed into law by Republican Governor Pat McCrory the same day.

"When it looks like all you want to do is sanction discrimination against folk and mistreat them, you cause a totally different reaction in the African-American community," said Dan Blue, a black lawmaker and the Democratic leader of the North Carolina Senate.

In his state, the coalition including the NAACP protesting the bathroom law also worked together to fight a state ballot initiative that banned same-sex marriage in 2012 and a more recent state voting law seen as disenfranchising minorities.

Distrust is similar in Mississippi, where Republican Governor Phil Bryant signed his state's religious objections bill after designating all of April to honor the heritage of the pro-slavery Confederacy in the U.S. Civil War.

"They see it not just as a LGBT issue but as a Pandora's box being opened back up to allow discrimination," said Erik Fleming, a former black state legislator who is now director of advocacy and policy for the American Civil Liberties Union of Mississippi, where a judge has rejected its challenge to the state's law.

"There's an old saying: 'We’ve seen this movie before.'"