WASHINGTON — The Senate approved legislation on Thursday night that would repeal President Obama’s landmark health care law, a goal of Republicans since the law was adopted in March 2010.

The measure, which would also halt federal financing for Planned Parenthood, will now be sent to the House, which adopted a different version last month. The bill is ultimately expected to pass both chambers, but faces certain veto by Mr. Obama.

Congress has held dozens of votes to gut the health care law, but this bill would be the first to reach the president’s desk.

The Senate vote was 52 to 47. Two Republicans, Senators Mark S. Kirk of Illinois and Susan Collins of Maine, joined 45 Democrats in opposition. Senator Bernie Sanders, the Vermont independent who is seeking the Democratic nomination for president, did not vote.