President Trump on Sunday issued a new order indefinitely banning almost all travel to the United States from seven countries, including most of the nations covered by his original travel ban, citing threats to national security posed by letting their citizens into the country.

Starting next month, most citizens of Iran, Libya, Syria, Yemen, Somalia, Chad and North Korea will be banned from entering the United States, Mr. Trump said in a proclamation released Sunday night. Citizens of Iraq and some groups of people in Venezuela who seek to visit the United States will face restrictions or heightened scrutiny.

People seeking access to the United States as refugees are not covered by the proclamation, officials said. Entry of refugees is currently limited by the president’s original travel ban, and officials said the administration was preparing new rules for refugees that should be announced within days.

Mr. Trump’s original ban blocked all travel to the United States by refugees as well as nationals of seven countries, including Sudan, Libya and Somalia. In the new security review, Sudan was deemed to meet the security standards and was removed from the list of countries with travel restrictions.

Protesters rally against the separation of families under President Trump’s travel ban in New York on June 29. Alba Vigaray / EPA file

Officials said Somalia did, barely, meet the security standards set by the United States, but will still be subject to a ban on emigration and heightened scrutiny for travel because it is a safe haven for terrorists.

Somalis will no longer be allowed to emigrate to the United States, but may visit with extra screening. That means that students already in the United States can finish their studies and employees of businesses in the United States who are from the targeted countries may stay for as long as their existing visas remain valid. People whose visas expire will be subject to the travel ban, officials said.

In a statement released by the White House, Mr. Trump defended the new proclamation, saying that “we cannot afford to continue the failed policies of the past, which present an unacceptable danger to our country. My highest obligation is to ensure the safety and security of the American people, and in issuing this new travel order, I am fulfilling that sacred obligation.”