Missouri state senators voted down a proposal early Wednesday to ban discrimination based on gender identity and sexual orientation, in what was a loss for LGBTQ advocates.

Democratic state Sen. Jill Schupp's amendment would have banned discrimination against lesbian, gay, bisexual and transgender people and covered employment, housing and public accommodations.

The Creve Coeur Democrat asked colleagues to add the measure to a contested Republican-backed bill to make it more difficult to sue for discrimination.

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

In earlier debate, Schupp argued its passage would have shown that people in Missouri "care about treating people fairly" and provided LGBTQ people with equal rights.

Lawmakers voted 20-10 against it.

The underlying legislation received initial approval in a voice vote earlier Wednesday after Democrats railed against it for hours. Lawmakers hammered out a compromise after midnight to scale the bill back.

An earlier version of Republican state Sen. Gary Romine's bill would have required plaintiffs bringing discrimination lawsuits to prove that race, religion, sex or other protected status was the sole reason for discrimination or being fired, not just a contributing factor. It also would have prevented employees from suing other workers, capped damages in discrimination lawsuits and exempted state agencies from punitive damages.

Republican and pro-business backers say it's too easy to sue for discrimination in the state and touted the bill as a needed fix. But the president of Missouri's NAACP chapter, Democratic state senators and others slammed it as a way to enable workplace discrimination without legal consequences. Kansas City Democratic state Sen. Kiki Curls called the earlier proposal "offensive and hurtful and degrading to every black person in this state."

Under the compromise, plaintiffs would need to prove that a protected status played a motivating factor in discrimination or firing. That's a higher standard than what's currently used, but not as strict as what had been proposed by Romine earlier.

"Our entire intent has never been to promote or support or allow discrimination in any place in this great state of Missouri," said Romine, of Farmington. "Our intent in this bill is to make sure that we have a standard in the statutes that is fair to the employee and employer alike."

Follow NBC Out on Twitter, Facebook and Instagram.