During a White House meeting with senior pharmaceutical executives he told the firms to manufacture more of their drugs in the US.
However, he also vowed to help the firms by speeding the approval of new medicines and by cutting taxes.
His pledges helped to send shares in many of the biggest US drugmakers higher on Tuesday.
Drugmakers have faced intense criticism from US politicians - including Mr Trump - as well as insurance companies and patients' groups over the high cost of new medicines and price hikes in some older generic drugs.
Among those attending the meeting were the bosses of Merck, Johnson & Johnson, Novartis, Amgen and the head of the Pharmaceutical Research and Manufacturers of America (PhRMA) lobbying group.
"US drug companies have produced extraordinary results for our country but the pricing has been astronomical for our country, we have to do better," Mr Trump told them in the meeting.
"We have to get even better innovation, and I want you to move your companies back to the United States," he said.
To help the firms, Mr Trump said his administration was "going to be lowering taxes big league".
"We're going to be getting rid of regulations that are unnecessary - big league," he added.
The president's promise to speed up approvals by the Food and Drug Administration for new medicines sparked strong gains in pharmaceutical shares.
Shares in Merck and Amgen rose by about 1% while Novartis was up more than 2% on Wall Street.
The Nasdaq Biotech Index gained nearly 3% after the meeting and the S&P 500 health care index rose 1.4%.
Investors had sold off shares in drugmakers in recent weeks following heavy criticism from Mr Trump - supported by Democratic Senator Bernie Sanders - over drug pricing.
However, senior pharmaceutical executives welcomed Mr Trump's proposals on Tuesday to cut taxes and loosen regulations.
"We believe if these policies are enacted, it will translate to up to 350,000 new jobs over the next 10 years as a result of growth in the biopharmaceutical industry," said Stephen J. Ubl, chief executive of PhRMA.
Amgen chief executive, Robert Brad, said in the meeting that his firm would add 1,600 jobs in the US - a move welcomed by the president.
US President Donald Trump has called on pharmaceutical bosses to cut "astronomical" drug prices.