Updated

Legislation allowing private adoption agencies to discriminate against gay prospective parents is on its way to Virginia's governor, who has said he will sign it.

The Senate voted 22-18 Tuesday to pass legislation allowing private agencies to deny placements that conflict with their religious or moral beliefs, including opposition to homosexuality. The House had already passed the bill, which only needs Republican Gov. Bob McDonnell's signature to take effect July 1.

North Dakota is the only other state with such a law.

Democrats Charles Colgan and Phillip Puckett joined all 20 Senate Republicans in voting for the so-called "conscience clause" legislation.

Proponents say the measure protects the religious rights of agencies that contract with the state to provide child placement services. Opponents say the state should not sanction discrimination.