The state Senate of North Dakota has passed legislation that will bar discrimination on the basis of sexual orientation and gender identity in matters of employment.

Senate Bill 2278 also applies to public accommodations, housing, state and local government services, insurance and credit transactions.

The legislation would add sexual orientation, which is defined in the bill to include gender identity, to the list of classes protected under North Dakota’s existing anti-discrimination laws.

The state Senate approved it 27-19 on Wednesday.

The bill now moves to the state House of Representatives, and will also require the approval of Governor John Hoeven to become law.

“If someone is not doing their job, or habitually tardy, or doesn’t get along with people, they can still be fired, whether gay, lesbian or straight,” said Senator Tom Fiebiger, a Fargo Democrat who sponsored the bill.

“What employers can’t do under this law is fire someone because they are gay.”

The bill has exemptions for religious groups after the North Dakota Catholic Conference complained.

“SB 2278 provides no protection to employers, including religious entities, for those instances where a prohibition against sexual activity outside of marriage is a legitimate qualification for a particular job. Moreover, SB 2278 provides no protection for churches, private schools, and youth organisations, such as scouting organisations, from being forced to violate their sincerely-held beliefs.”

The NDCC also criticised the decision to give legal protection to “homosexual activity, as distinguished from homosexual tendency, (which) is morally wrong.

“The unique legal status granted by the bill’s definition of sexual orientation appears to encompass not only homosexual inclinations, but also other sexual activities, homosexual or heterosexual, outside of marriage.

“Civil rights categories should not be used to cover a particular group’s activities, especially when those activities are morally objectionable.”

Gay rights group the Human Rights Campaign said it worked closely with the North Dakota Human Rights Coalition (NDHRC) to help build support for the legislation.

“The Human Rights Campaign applauds Senator Tom Fiebiger and other senators in North Dakota for voting to reject discrimination,” said HRC President Joe Solmonese.

“Millions of Americans live in cities, counties and states where discrimination based on gender identity and sexual orientation is still legal.

“Particularly in these tough economic times, no person should have to face the added worry of experiencing discrimination simply because of who they are.

“This vote in the North Dakota state Senate gives meaning to the principle that workers, housing and credit applicants, and people seeking public services should be evaluated based on their own abilities and merits — not based on their gender identity or sexual orientation.”

North Dakota already prohibits discrimination on the basis of race, colour, religion, sex, national origin, age, disability, marital status, and status of public assistance. Senate Bill 2278 would add protections for sexual orientation and gender identity.

More than 100 cities and counties across the USA now prohibit employment discrimination based on both gender identity and sexual orientation.

12 states and the District of Columbia have protections in place. An additional eight states and 80 cities and counties prohibit discrimination based on sexual orientation alone.

Attempts by the US Congress to pass a federal law protecting gay, lesbian, bisexual and trans Americans from workplace discrimination fell apart amid acrimonious claims and counter-claims over trans rights.

In November 2007 the Employment Non-Discrimination Act was passed by the House by 235 to 184.

ENDA was originally designed to make it illegal to fire, refuse to hire or promote a person based on sexual orientation or gender identity.

The decision to remove trans people from the scope of the legislation caused anger among the LGBT community in the US, with many demanding an “all or nothing” stance.

Some House Democrats did not want ENDA to include protections for trans people, fearful of a backlash from conservatives.

President Barack Obama supports the legislation.