The Republicans in the Missouri Senate have forced an end to a Democratic filibuster of an anti-gay law.

Senate Joint Resolution 39, which is backed by the state’s Republican majority, would add a constitutional amendment protecting individuals who want to discriminate against married same-sex couples on the ground of religion.

The law would ban the government from pursuing any “penalty” against those who discriminate, as long as they have “a sincere religious belief concerning marriage between two persons of the same sex.”

The bill came to the floor at 4:20 PM on Monday – but the measure has been met with resistance from the state’s Democratic Senators, who have been attempting to block the legislation by filibustering – talking non-stop in an effort to halt the legislation.

The party’s Senators have talked it out for 39 hours without a break, refusing to bow to pressure and preventing the law from coming to a vote, stretching the issue out over three days.

Many of the lawmakers have not slept or showered, with Democratic Senator Jason Holsman joking: “I’m probably pretty rank at this point”.

Hillary Clinton and Bernie Sanders were among those to praise the actions of the “heroic” Senators, led by Democrat Maria Chappelle-Nadal, who led the debate through many long hours.

However, after 39 hours of stalling, the Republicans used an obscure procedural manoeuvre to force the issue to come to a vote, and passed the bill by a vote of 21 to 11.

The Republicans ended the debate by ‘moving the previous question’, a generally frowned-upon manoeuvre which can force an issue to come to a vote even when a debate has not concluded.

The legislation will need to pass through the Senate once more for an administrative approval vote, before being sent to the Republican-dominated House of Representatives.

The state’s Democratic governor Jay Nixon is openly opposed to the law, but he may be unable to block it entirely as Republicans control both houses with a two-thirds majority.

Sarah Warbelow of the Human Rights Campaign said: “Religious freedom is one of our nation’s fundamental values, and that’s why it’s firmly protected in the First Amendment of the U.S. Constitution.

“This reckless legislation has nothing to do with religious freedom and everything to do with enabling discrimination against LGBT Missourians and their families.

“Discrimination against LGBT people should never be sanctioned by the state, and we call on the Missouri House of Representatives to resoundingly reject this outrageous resolution.”

Jeffrey Mittman of ACLU Missouri said: “Laws that promote discrimination are anti-democratic, harm Missouri families, and – as we’ve learned in Indiana – are bad for our economy.

“That is why so many Missourians, including clergy and business leaders, strongly oppose any effort – such as SJR 39 – that would seek to enshrine inequality in our Missouri Constitution.”

Steph Perkins of Missouri LGBT group PROMO said: “We agree that religion is a fundamental right, which is why it is protected in the First Amendment of the U.S. Constitution and in our existing Human Rights Act. We are not arguing that clergy and churches should be denied their freedom of religion.

“But those same religious beliefs cannot be used as a reason to deny someone the same services that are offered to the rest of the public by private businesses. And that is exactly what SJR 39 aims to do. Businesses and organizations have already been rightly concerned about the consequences of this bill and are outspoken in their opposition.”

During the historic filibuster, senators have talked about everything from food to their childhood – with Democratic Senator Maria Chappelle-Nadal speaking at length about her love of playing dominoes.

She said 17 hours in: “I can do this all day… this is my prime time.”

Senator Chappelle-Nadal appeared to be slightly worse for wear on the night shift – continuing to talk out the bill on Tuesday night. It came to a vote early on Wednesday morning.