WASHINGTON — President Obama will endorse a bill to repeal the law that limits the legal definition of marriage to a union between a man and a woman, the White House said Tuesday, taking another step in support of gay rights.

Jay Carney, the White House press secretary, said Mr. Obama was taking the additional step away from the Defense of Marriage Act — which the administration said earlier this year it would no longer defend in court — in order to “uphold the principle that the federal government should not deny gay and lesbian couples the same rights and legal protections as straight couples.”

If the measure passes, it would make same-sex couples eligible for certain federal benefits that have previously been available only to heterosexual married couples.

The new legislation, which is being sponsored by Senator Dianne Feinstein, Democrat of California, is unlikely to pass Congress this year, but will nonetheless face its first committee hearing on Wednesday before the Senate Judiciary Committee.