President Barack Obama called the Supreme Court's landmark ruling upholding his health-care reform "a victory for people across the country."
Mitt Romney said he will work "on my first day as president" to repeal the law if he's elected in November.
They spoke Thursday shortly after the court, in a 5-4 decision, upheld the heart of the law.
"Today's opinion was a victory for people across the country," Obama said in the White House. He said it will make their lives more secure.
Minutes earlier, Romney sought to make the presidential race a referendum on the health-care law, saying: "If we want to get rid of Obamacare, we're going to have to replace Obama."
"Help us defeat Obamacare," Romney said, speaking in front of the U.S. Capitol.
"What the court did not do on last day in session, I'll do on my first day as president and act to repeal Obamacare."
The nation's highest court on Thursday upheld the requirement at the center of the president's overhaul that individuals be compelled to purchase health insurance or face penalties.
The decision capped years of debate and battles over the nation's health care, but didn't end the debate about the Affordable Health Care law, which Obama signedon March 23, 2010.
An audible exhalation rippled through the courtroom through when Chief Justice John Roberts announced the decision.
Onlookers, including justices' spouses and retired Justice John Paul Stevens, had to wait several minutes for Roberts to make clear the law's individual mandate had been upheld. And when all the opinions and dissents had been read, a crowd inside the courtroom applauded as the justices left on the final day of their session. They return in October.
Outside, a crowd stood waiting for the decision, with belly dancers in red and blue shimmying to a drummer's beat and dueling protesters chanting "Hey, hey, ho, ho, Obamacare has got to go!" or, "We love Obamacare!"
Polling has suggested that most Americans oppose the law. The Romney campaign said it had collected more than $300,000 in online donations in the hours after the decision was announced.
But Obama said the decision upholds the fundamental principle that in America — the wealthiest nation on Earth — no one should fall into financial ruin because of an illness.
The president said the decision means that people with existing medical conditions will not be discriminated against and people will be able to afford quality health care.
It's time to move ahead, he said.
"The highest court of the land has now spoken. We will continue to implement this law and we'll work together to improve on it where we can," he said at the White House.
"What we won't do — what the country can't afford to do — is re-fight the political battles of two years ago or go back to the way things were."