The Wyoming Senate on Wednesday killed a bill that sought to outlaw the recognition of out-of-state gay marriages, the Wyoming Tribune-Eagle reported.

Senators rejected the legislation with a narrow 16 to 14 vote, ending weeks of negotiations between the two chambers and a heated debate.

The bill won a narrow 31 to 28 victory in the House, earlier in the day.

Both chambers had previously approved differing versions of the bill.

Wednesday's version stripped out a provision that would guarantee gay and lesbian couples in out-of-state civil unions access to Wyoming courts to get a divorce or for other disputes.

Wyoming bans gay couples from marrying but state law also recognizes any valid marriage performed outside its borders. Social conservatives worry that a legal challenge could use the loophole to legalize gay marriage.

Wednesday's vote was the latest defeat for social conservatives who had pinned their hopes on the Legislature's recently-elected Republican majority.

Lawmakers last week killed a proposed constitutional amendment defining marriage as a heterosexual union, thereby banning gay and lesbian couples from marrying.