Updated

President Obama on Friday vetoed legislation to repeal most of his signature health care law, saying the bill would do “harm” to millions of Americans.

The move was widely expected, after Republicans for the first time succeeded in sending an ObamaCare repeal bill to the president’s desk. The legislation that Obama vetoed also would cut federal funding for Planned Parenthood.

While Congress may try to override, Republicans do not currently have the votes to do so.

Republicans, though, say they met two goals by passing the bill: keeping a promise to voters in an election year, and showing their ability to repeal the health law if a Republican wins the presidency.

“This is the closest we have come to repealing ObamaCare,” House Speaker Paul Ryan, R-Wis., said Thursday.

As the next step, Ryan wants to work on a proposal to replace the health care law. As he said in a statement Wednesday, the goal is to lay the groundwork for repealing and replacing the law should a Republican win the presidency this November.

“It clears the path to repealing this law with a Republican president in 2017 and replacing it with a truly patient-centered health care system,” he said. “We will not back down from this fight to defend the sanctity of life and make quality health care coverage achievable for all Americans.”

Though Republicans tried dozens of times to pass a full or partial repeal bill, they were only able to get this one to Obama’s desk because the Senate passed their version under special rules that protected it from a Democratic filibuster. The House followed suit this week.

Still, it takes a two-thirds threshold to override a presidential veto. In the House alone, Republicans are shy of that amount by nearly 50 votes.

In a lengthy written statement explaining his veto, Obama on Friday said the bill would “reverse the significant progress we have made in improving health care in America,” warning that it would increase the number of uninsured.

“Rather than refighting old political battles by once again voting to repeal basic protections that provide security for the middle class, Members of Congress should be working together to grow the economy, strengthen middle-class families, and create new jobs,” he said.

Republicans argue that the legislation is harming the economy, and wrongly forcing Americans to buy insurance.

The Associated Press contributed to this report.