The countries covered are Afghanistan, Equatorial Guinea, Eritrea, Haiti, Iran, Yemen, Congo-Brazzaville, Libya, Myanmar, Somalia, Sudan and Chad.
Stricter restrictions will also apply to visitors from Burundi, Cuba, Laos, Sierra Leone, Togo, Turkmenistan and Venezuela.
In a video on social media, Trump links the new ban to the deed in Boulder, Colorado, on Sunday. Then a man attacked a support action for hostages in Gaza and at least twelve people were injured. In the video, Trump says the incident highlights the dangers associated with certain visitors staying longer than their visa allows.
The suspect for the attack in Colorado is from Egypt, a country that is not on the list for the new entry bans. But according to US authorities, the man stayed despite his tourist visa having expired.
Trump signaled plans for a new ban in January and now also has the Supreme Court on his side. Some of the countries, but not all, were on the list of countries with entry bans during Trump's first term.
The ban comes into effect on Monday US time. This is to avoid chaos at airports, which occurred in the US when a similar measure was introduced in 2017 without any direct warning.