The Massachusetts Senate has approved a bill to ban discrimination against transgender people in public accommodations.

The Senate passed the bill with a 33-4 vote Thursday.

Democratic Sen. Sonia Chang-Diaz said it's past time for Massachusetts to stay true to its history as a civil rights pioneer. Seventeen states have similar laws.

Democratic Senate President Stan Rosenberg backed the bill, which would bar discrimination in restaurants, malls and other public locations.

The bill would also let transgender people use bathrooms that correspond with their gender identity.

Opponents say the bill would violate the privacy rights of girls and women.

Massachusetts Family Institute President Andrew Beckwith said women will have no protection against being exposed to naked men in locker rooms if the bill passes.

The debate heads to the House.