President Trump took his most significant action yet to lower drug prices, saying his administration is moving to stop “global freeloading” by foreign nations when it comes to the price that Americans pay for prescription drugs. The announcement is a sign that the president and his aides are shifting their focus to health care two weeks before the midterm elections.

In a speech Thursday afternoon at the Department of Health and Human Services, Trump said his administration would be taking the “revolutionary” step of allowing Medicare to directly negotiate prices with drug companies that he says have “rigged” the system, leading to U.S. patients paying more for their medicines.

“Americans pay more so other countries can pay less,” Trump said. “It’s wrong. It’s unfair.”

Trump’s remarks were the first as president at HHS and come at a time when health care is playing a defining role in midterm campaigns, with Democrats slamming Republicans over whether they support protecting access to health care for people with preexisting conditions. Trump argued that other countries were being “very disrespectful” by selling their prescription drugs to Americans for higher prices than their citizens are paying for them.

Under the new approach, the Centers for Medicare and Medicaid Services (CMS) plans to experiment with a new way of setting prices for most drugs administered through Medicare’s Part B program, which covers all doctor’s visits for seniors and the drugs prescribed to them during their visits.

HHS estimates the new pricing index — which the agency says would apply to 50 percent of the country — would save Medicare $17.2 billion over five years. Medicare now pays the average sales price of a medicine in the United States, plus a fee based on a percentage of that price. Under the new model, Medicare would pay fees to doctors that are more closely aligned with what other countries pay.

Trump’s has said lowering drug prices is a key goal of his administration. Thursday’s announcement suggests a more prominent role for the government in setting drug prices than many Republicans may be comfortable with and is likely to face significant pushback from the pharmaceutical industry.

It also highlights an increasing push by the president personally and by his administration more generally to emphasize health care in the run-up to the elections, an issue polls show is at the top of voters’ minds. On Wednesday afternoon the president signed sweeping legislation to tackle the opioid drug epidemic, and he has tweeted that “all Republicans” will protect people with preexisting health conditions in response to Democratic charges otherwise.

“It’s hard to take the Trump administration and Republicans seriously about reducing health care costs for seniors two weeks before the election when they have repeatedly advocated for and implemented policies that strip away protections for people with pre-existing conditions,” Senate Minority Leader Charles E. Schumer (D-N.Y.) said in a statement.

On the campaign trail, Democrats have been hammering away at Republicans for their failed attempt last summer to repeal and replace the Affordable Care Act, which enabled people with prior illnesses to receive affordable health care. Trump’s administration has worked to chip away at several ACA requirements, including supporting GOP repeal of the individual mandate in the party’s tax overhaul and supporting waivers for Medicaid work requirements.

Trump’s announcement on drug prices came hours after HHS released a report highlighting the steep spending by the U.S. government on prescription drugs.

The report compares the price paid by Medicare for 27 prescription drugs with the average price paid for the same drugs by countries with similar economic conditions. It concludes the higher U.S. prices means Medicare pays nearly twice as much as the program would pay for the same or similar drugs in other countries. During his speech, Trump cited an example of a “common” cancer drug that he said is seven times as expensive for Americans as for people living outside the United States, though he did not name the drug specifically.

“Medicare could achieve significant savings if prices in the U.S. were similar to those of other large market based economies,” the report concludes.

Trump’s announcement represents the next leg in the administration’s quest to appear tough on the pharmaceutical industry. Medicare, which covers 55 million elderly and disabled Americans, is responsible for 29 percent of the nation’s prescription drug spending.

HHS Secretary Alex Azar criticized a system in which other countries pay significantly less for drugs than the U.S. government. The United States is the biggest funder of research and development in the pharmaceutical sector yet lacks the bargaining power to bring prices down — unlike in countries with public health-care programs.

“For some drugs we are paying upwards of 300 or 400 percent, and in some instances we pay 700 percent more than other countries do,” Azar told reporters after Trump’s address. “President Trump asked us to fix this problem and here’s how we plan to do it.”

The new payment model will affect only drugs purchased and dispensed by doctors themselves under Medicare’s Part B program — not medicines purchased at pharmacies. In the five-year experiment, carried out through CMS’s innovation center, prices will be gradually and increasingly pegged to the new international index instead of average U.S. sales price.

The proposed rule also sets up a first-time system inside Medicare in which drugs would be sold to vendors instead of directly to doctors and hospitals. It would remove incentives for doctors to prescribe more-expensive drugs by paying them a flat fee for storing the medications instead of a fee based on a percentage of the drug’s price.

Officials said the aim is to introduce more competition into Part B, which has doubled its spending on drugs since 2006. In contrast, Part D spending on drugs dispensed by pharmacies has risen much more slowly. The report notes Part B is not subject to restrictions on the drugs that are covered, meaning there is little incentive to tamp down costs.

The 19-page HHS report, which looks specifically at drugs purchased and dispensed by doctors under Part B, “provides troubling insight into how the current international drug pricing system has put America in last place,” Azar tweeted.

Protecting people with preexisting conditions and bringing down prescription drug prices rank high among voters’ concerns headed into the elections. In a March Kaiser Family Foundation poll, 8 in 10 respondents said drug costs are unreasonable and 92 percent said passing legislation to bring down the cost of prescription drugs should be a top or important priority.

Trump kicked off his drug-costs initiative in May in the White House Rose Garden, where he announced a 44-page blueprint containing ideas that could threaten industries along the drug supply chain.

The president in May also claimed drug companies would be announcing “massive” voluntary price cuts. When Pfizer and Novartis announced over the summer they were pulling back on some planned price increases, Trump touted it as proof his pressure tactics were working.

The administration has moved twice this month to lower drug prices in other ways. Trump signed a bill banning “gag clauses” that prohibited pharmacists from telling patients when they could save money by paying cash or trying a cheaper alternative medicine. Last week, Azar proposed a rule requiring companies to list in television ads the price for a 30-day supply or course of treatment for drugs they are trying to sell.