Republicans in Congress welcomed the president’s attention to high drug prices and promised to review his proposals, which Mr. Trump said would “derail the gravy train for special interests.”

Democrats embraced the opportunity to push health care back to the center of the political debate.

“President Trump offered little more than window dressing to combat the rising cost of drugs — a problem that is pinching the pocketbook of far too many Americans,” Senator Chuck Schumer of New York, the Democratic leader, said after the speech. “We Democrats have offered a better deal on prescription drugs through true transparency, Medicare Part D negotiation, and a cop on the beat to police and stop exorbitant price hikes.”

After supporting some of those same proposals on the campaign trail, Mr. Trump pivoted to a different approach. He said his administration would provide new powers for Medicare’s private prescription drug plans, known as Part D, to negotiate lower prices but he would not use the purchasing power of the federal government to conduct direct negotiations. He said he would make it easier for pharmacists to inform patients of cheaper alternatives and would speed the approval of over-the-counter drugs “so that patients can get more medicines without prescription.”

Mr. Trump also denounced foreign countries that he said “extort unreasonably low prices from U.S. drugmakers” so that their citizens often pay much less than American consumers for the same drugs.

“America will not be cheated any longer, and especially will not be cheated by foreign countries,” Mr. Trump said. He directed his trade representative to “make fixing this injustice a top priority” in negotiations with every trading partner.

“It’s time to end the global freeloading once and for all,” Mr. Trump said.

It is not clear why higher profits in other countries would be passed on to American consumers in the form of lower prices, and officials in those countries pushed back hard.

“With our price regulations, drug companies are still making profits — just lower profits than in the United States,” said Dr. Mitchell Levine, the chairman of Canada’s Patented Medicine Prices Review Board, which reviews prices to ensure they are not excessive.