President Barack Obama traveled to Milwaukee to celebrate the city’s victory in the Healthy Communities Challenge, a competition between 20 cities to increase the number of Americans with health insurance during the latest Health Insurance Marketplace open enrollment period. (Tom Lynn/AP)

President Obama offered a glimpse Thursday of how he might campaign for his party’s nominee this fall and seek to cement his legacy in the White House.

The reason for his speech here was the sixth anniversary of the Affordable Care Act, but the setting was telling: Obama defended perhaps the most controversial legislative achievement of his presidency before a Latino-dominated audience, a key constituency for Democrats this fall, in a swing state that will be critical to determining the next commander in chief.

Obama spoke at Bruce-Guadalupe Middle School, which is part of a broader community campus that includes the Milwaukee Latino Health Coalition. There are about 156,000 Hispanic voters in Wisconsin and they account for about 6.5 percent of the electorate, according to the Pew Research Center.

Democrats are betting that Republican presidential front-runner Donald Trump’s calls to build a wall on the southern border of the United States and his suggestion that many Mexicans coming to the country were “criminals, drug dealers and rapists” will drive Latino voters to support the eventual Democratic nominee.

Obama made only passing reference to the presidential race Thursday, focusing instead on gains that he attributed to the health-care law. According to an administration report, an estimated 20 million people have gained health coverage since the law was passed in 2010.

Today, fewer than 1 in 10 Americans lack health insurance, and health-care prices have risen since 2013 at the slowest rate in 50 years, Obama said. The administration described the drop in numbers as “historic.”

“We have seen progress, in the last six years, that the country has sought for generations,” Health and Human Services Secretary Sylvia Mathews Burwell said in a statement.

Thursday’s report was an update of an HHS estimate from September, which found that 17.6 million uninsured adults had gained coverage as a result of the ACA. It said that more than 6 million adults ages 19 to 25 have gained insurance under the law. Gains in coverage among previously uninsured adults were strong across all racial and ethnic groups, according to the report.

“You wouldn’t know any of this if you listened to the politicians on the other side who are obsessed with repealing this law,” Obama said. “To them, the facts I just mentioned don’t matter.”

Obama celebrated Milwaukee as one of the Affordable Care Act’s recent success stories. Among 20 cities with large numbers — or a high percentage — of uninsured residents, Milwaukee was deemed by the White House as the most successful at signing people up for health insurance during the most recent enrollment period.

“You got nearly 90,000 people to sign up,” Obama told the cheering crowd in Milwaukee. “You are proof that the Affordable Care Act works.”

About 38,000 of those who signed up in Milwaukee were selecting an insurance plan for the first time through one of the marketplaces created by the act, the White House said.

Nationwide, about 13 million Americans signed up for health-care coverage through one of the marketplaces during the most recent enrollment period.

In a separate announcement, HHS said it is ahead of its own schedule in working to shift how Medicare pays for care — from the quantity of tests and services provided beneficiaries to the quality of the care delivered.

Federal health officials had set what they described Thursday as the “ambitious stretch” goal of having 30 percent of the program’s payments reflect this new approach by the end of this year. They met their goal 11 months early, officials announced. In 2014 alone, they said, the result was $411 million in health-care savings.

Obama was introduced in Milwaukee by Brent Brown, a Republican who told the crowd that he had cursed the president and had never voted for him. Brown, who was diagnosed with an autoimmune disease, said he was “literally a dead man walking. Hope gone,” before the act’s passage. “But then this guy signs this bill . . . and I receive the care I so desperately need.”

“Swallow your pride as I am doing right now,” Brown told Republican lawmakers. “Do what is right.”

The testimonials and numbers touted by the White House, however, have not done much to blunt attacks on the law from Republicans, who have derided the law as too costly, a “jobs killer” or a prelude to rationing health care. They also have not resonated with a majority of Americans, who in polls have said that they do not like the law.

For many, the law, also known as Obamacare, has become synonymous with the deep polarization and mistrust in the country. During the past six years, the law has survived two Supreme Court challenges and nearly 60 attempts by Republican lawmakers to repeal it, in whole or in part.

“Repeal has been a rallying cry,” Obama said.

All of the Republican presidential candidates have said that they would repeal it as one of their first acts in office. Democratic front-runner Hillary Clinton has repeatedly praised the law and promised to improve upon it.

In Milwaukee, the president often slipped into a salesman’s patter as he celebrated the law, noting insurance under the act for many Americans was less than “your cellphone bill,” less than a “cable bill” and in many cases, less than “75 bucks a month.”

He rejected the notion advanced by many Republicans that the program was a “jobs killer,” noting that the country had seen jobs growth in every month since the act became law and that the unemployment rate had plummeted.

“It’s saving lives and it’s saving money, and we’ve done all this while creating millions of new jobs,” Obama said. “We’ve cut our deficits by 75 percent.”

Laurie McGinley contributed to this article.