Image copyright AP Image caption Protesters called for governors of both states to repeal the laws

The UK government has warned gay and transgender travellers to be careful in the US due to legislation in North Carolina and Mississippi.

"The US is an extremely diverse society and attitudes toward LGBT people differ hugely across the country," a travel advisory from the UK reads.

Newly passed laws in both states allow businesses to refuse service to LGBT people.

The advisory comes from the UK Foreign and Commonwealth Office.

In North Carolina, legislation passed by Governor Pat McCrory invalidates previously passed legislation from Charlotte, that state's largest city, that enacted LGBT protections.

His new law states that transgender people must use public bathrooms according to the gender on their birth certificates. Mississippi's law has a similar bathroom provision and also protects dozens of forms of businesses and services from being prosecuted by the government for refusing to serve LGBT people.

It is "both frightening and embarrassing that one of our nation's staunchest allies has warned its citizens of the risks" of travelling to the US, said Ty Cobb of the Human Rights Campaign.

"It is now more clear than ever that these terrible measures are not only harming individuals and taking an economic toll on the states, but are also causing serious damage to our nation's reputation, and the perceived safety of LGBT people who travel here."

Image copyright AP Image caption Companies have pulled business out of North Carolina over the law

Companies are curtailing their businesses in the states because of the law, and several entertainers have cancelled performances in both states over the law.

More than a dozen US states have passed or considered "religious liberty" laws, sparking controversy and protest across the country.

Supporters argue the bills protect religious beliefs, but most critics say they are actually legalised discrimination in the face of gay marriage becoming legal last year.

Republican front-runner for the US presidential race Donald Trump has weighed in on the bathroom provisions of the laws, saying people in North Carolina should be allowed to use the bathroom they feel is appropriate.

Asked whether reality television star Caitlyn Jenner could use any bathroom in Trump Tower in New York City, he said "That is correct."

"North Carolina did something that was very strong," Mr Trump told NBC's The Today Show. "And they're paying a big price."

Senator Ted Cruz has said he supports North Carolina's law.