The Senate vote was 65-31. The House had passed an identical version of the bill, 250-175, on Wednesday.
Link to S4023 as passed by the Senate today.
Obama was expected to sign it next week, although the change wouldn’t take immediate effect. The legislation says the president and his top military advisers must certify that lifting the ban won’t hurt troops’ fighting ability. After that, there’s a 60-day waiting period for the military.