Media playback is unsupported on your device Media caption Republican Governor Phil Bryant signed the law despite criticism that it discriminates

The governor of Mississippi has signed a controversial bill that allows businesses to refuse service to gay couples based on religious beliefs.

Governor Phil Bryant signed HB1523 into law on Tuesday amid opposition from equal rights groups and businesses.

He said the bill "protects sincerely held religious beliefs and moral convictions".

Protesters say the bill would allow for lawful discrimination of gay, lesbian, bisexual and transgender people.

The bill comes at a time when numerous US states are passing or considering similar laws.

North Carolina recently passed a bill that revokes protections for LGBT people and requires transgender individuals to use restrooms based on their biological gender identity.

Major companies and CEOs signed on to a letter urging North Carolina Governor Pat McCrory to repeal the law.

Tech company PayPal has withdrawn its plan to open an operations centre, which would have employed 400 people, over the law.

The governor of Georgia rejected a similar bill after pressure from major companies that do business in the state.

Image copyright AP Image caption Protesters gathered outside the state capital the day before Mr Bryant signed it into law

Image copyright Getty Images Image caption Mr Bryant (left) signed the bill into law despite pressure from equal-rights groups

States have been drawing up religious freedom laws, largely under pressure from religious groups, in response to the US Supreme Court ruling last summer legalising gay marriage.

The intention of the Mississippi bill, the "Protecting Freedom of Conscience from Government Discrimination Act," is to protect people who think marriage is between one man and one woman, that sexual relations should only happen in marriages and that gender is not changeable.

Mr Bryant, defending himself on Twitter after signing the bill, said the bill does not limit rights of citizens under the US Constitution and was designed to "prevent government interference in the lives of the people".

Churches, religious charities and private business can use the law to legally not serve people whose lifestyles they disagree with. Governments must still provide services, but individual government employees can use the law to opt out.

The bill also ensures that anyone who wishes to establish "sex-specific standards" for restrooms and dressing rooms is free to do so.

"This bill flies in the face of the basic American principles of fairness, justice and equality and will not protect anyone's religious liberty," the American Civil Liberties Union said in a statement following the bill's passage.

"Far from protecting anyone from 'government discrimination' as the bill claims, it is an attack on the citizens of our state, and it will serve as the Magnolia State's badge of shame."