WASHINGTON (AP) — Many Republicans had hoped to avoid the gay marriage debate in the run-up to the 2016 presidential race.

But as the backlash intensifies over a so-called religious freedom law in Indiana, the leading Republican White House contenders have been drawn into a messy clash that highlights the party's strong opposition to same-sex marriage and threatens to inject social issues into the early stages of the presidential primary season.

The debate has energized Democrats nationwide while exposing sharp divisions between Republicans and local business leaders who oppose a law, which critics say allows business owners to deny services to same-sex couples on religious grounds. Opponents fear, for example, that caterers, florists, photographers and bakers with religious objections to same-sex marriage will be allowed to refuse to do business with gay couples. Supporters of the law say it will only give religious objectors a chance to bring their case before a judge.

It is a critical time for the Republican Party, which has recently played down its opposition to abortion rights and same-sex marriage to help attract more women and younger voters before the next presidential election.

Polling suggests a majority of the American electorate supports gay marriage, but the most conservative Republicans do not.

Gay marriage is legal in 37 of the 50 U.S. states, following a series of legal rulings. The U.S. Supreme Court is preparing to rule later this year on whether gay couples should be allowed to wed nationwide.

The leading Republican presidential prospects overwhelmingly defended Indiana's law, breaking with local business leaders in favor of conservatives across the country.

"It's a total head-scratcher," former Illinois Republican chairman Pat Brady said of the Republican presidential hopefuls who defended the law. "We're trying to attract voters and win elections. We can't scare people away."

It is a huge moment for Indiana Gov. Mike Pence, a Republican presidential prospect himself, who has become the public face of the law.

"It's been a tough week," Pence said in a Tuesday press conference. He called for a legislative fix to address what he called a perception problem just five days after signing the bill into law.

Florida Gov. Jeb Bush, one of the early favorites for the Republican nomination, defended the law in a Monday radio interview, saying it was "simply allowing people of faith space to be able to express their beliefs."

Texas Sen. Ted Cruz, who announced his presidential campaign last week, said the Indiana governor was "holding the line to protect religious liberty."

At least two other Republicans considering a White House bid, Texas Gov. Rick Perry and former Arkansas Gov. Mike Huckabee, also backed the law.

Some economic-minded Republicans saw it another way.

"It takes our eye off the really important things to most people in this country: jobs, the economy and our security," said Ronald Weiser, former finance chairman for the Republican National Committee. "That's probably not the best thing for our party as a whole."

Last week, Pence signed the state Religious Freedom Restoration Act, giving heightened protections when businesses or individuals object on religious grounds to providing certain services.

Similar proposals have been introduced in more than a dozen states, and 19 other states have similar laws.

North Carolina Gov. Pat McCrory, a pro-business Republican, has criticized such a proposal in his state, telling The Associated Press on Tuesday that he's yet to see evidence of a problem the bill purports to fix.

Some companies and organizations in recent days canceled future travel to Indiana or halted expansion plans in the state. Apple CEO Tim Cook wrote an op-ed opposing measures in Indiana and Arkansas, while retail giant Wal-Mart has said the proposal sends the wrong message.

Democrats were united in their opposition to the law.

Hillary Rodham Clinton, expected to launch her Democratic presidential campaign in the coming weeks, tweeted last week, "Sad this new Indiana law can happen in America today." On Wednesday, she said Arkansas Gov. Asa Hutchinson should veto a similar bill.

Hutchinson had said he would sign the bill, but on Wednesday, he called on lawmakers to make changes.