He described the Chinese government’s moves to introduce the measure in Hong Kong as a “tragedy”.
Mr Trump also said he was “terminating” the US relationship with the World Health Organization over Covid-19.
China has told the West to “stop interfering” in Hong Kong.
The territory, a former British colony, enjoys unique freedoms not seen in mainland China. But many people there see the looming security law as bringing an end to Hong Kong’s special status, agreed under a 1984 agreement between China and the UK.
There are fears the proposed measure – which has sparked a wave of anti-mainland protests – could quash freedoms by making it a crime to undermine Beijing’s authority in the territory.
This week, Britain said that if China went forward with the law, it could offer British National (Overseas) passport holders in Hong Kong a path to UK citizenship.
On Friday, the UK Home Office confirmed that up to three million people with BNO status could acquire citizenship in this way – as long as they applied for and were granted a passport.
What did President Trump outline?
Mr Trump said that he no longer considered Hong Kong to be separate from China, and accused Beijing of violating its obligations under the 1984 agreement
“China has replaced One Country, Two Systems with One Country, One System”, Mr Trump told reporters in the White House’s Rose Garden, in a prepared statement that attacked China on several fronts.
“This is a tragedy for Hong Kong… China has smothered Hong Kong’s freedom.”
Currently, Hong Kong – a major global financial centre – enjoys a special status with the US compared to mainland China. It is treated as a separate customs and travel territory and so is not, for example, subject to trade tariffs applied by the US on the mainland.
Mr Trump also said sanctions would be imposed on Chinese and Hong Kong officials who were believed by Washington to be involved in eroding the territory’s autonomy. He did not outline what form these sanctions would take.
The State Department, he added, would revise its travel advisory for Hong Kong in light of “increased danger of surveillance” from China.
The president also said the US would suspend the entry of foreign nationals from China identified by the US as potential security risks. There are fears that this could affect thousands of graduate students.
No further details were given regarding the “termination” of the US relationship with the WHO. In April, the US president said he would halt funding to the UN agency because it has “failed in its basic duty” in its response to the coronavirus outbreak.
He accused it of mismanaging and covering up the spread of the virus after it emerged in China.
China’s new law: Why is Hong Kong worried?
How is Hong Kong run?
The Global Times newspaper – run by China’s ruling communist party – called the move towards revoking Hong Kong’s special status with the US “recklessly arbitrary”.
Hong Kong’s Justice Secretary Teresa Cheng told the BBC’s Chinese Service earlier on Friday that any threat of sanctions was unacceptable.
“Are the sanctions being imposed with a view to coerce another state to change their policy…? Any such sanctions are not going to benefit anyone,” she said.