The Trump administration plans to prohibit Americans from traveling to North Korea, the State Department announced Friday, citing serious risks of arrest and imprisonment in the isolated totalitarian state.

The ban, first disclosed by tour groups that specialize in travel to North Korea, comes in apparent retaliation for the detention of U.S. citizens there and the death of a young tourist who was held for nearly 18 months before being flown home in a coma.

Two tour companies, Koryo Tours and Young Pioneer Tours, said they were told the ban would be formally declared July 27 and would take effect a month later.

"The safety and security of U.S. citizens overseas is one of our highest priorities," State Department spokeswoman Heather Nauert said late Friday morning in announcing the forthcoming ban. "Due to mounting concerns over the serious risk of arrest and long-term detention under North Korea's system of law enforcement, [Secretary of State Rex Tillerson] has authorized a Geographical Travel Restriction on all U.S. citizen nationals' use of a passport to travel in, through, or to North Korea."

The ban would make U.S. passports invalid for travel to North Korea, although exemptions would allow Americans to obtain passports with a special validation for visits to the country. The restrictions will take effect 30 days after a notice is published in the Federal Register next week, Nauert said.

Otto Warmbier, a University of Virginia student from Ohio, used China-based Young Pioneer Tours to travel to North Korea in January 2016, only to be arrested on charges of attempting to steal a propaganda poster and sentenced to 15 years imprisonment with hard labor. He died June 19 at age 22, six days after being released in a coma and flown home to Cincinnati. Three other U.S. citizens remain imprisoned in North Korea.

Young Pioneer Tours said in a statement, "It is expected that the ban will come into force within 30 days of July 27th." After that, it said, Americans who travel to North Korea "will have their passport invalidated by their government."

North Korea marks "Victory Day" annually on July 27, when it celebrates the 1953 Korean War armistice as a military triumph in elaborate ceremonies.

Koryo issued a similar statement, saying the ban would make it illegal to visit North Korea "as a tourist."

Young Pioneer Tours announced last month after Warmbier's death that it would no longer take Americans to North Korea anyway. "Now, the assessment of risk for Americans visiting North Korea has become too high," the company said.

The U.S. government had discouraged Americans from traveling to North Korea but had not previously issued an outright ban.

Bill Richardson, a former New Mexico governor and Clinton administration Cabinet official who has negotiated with North Korea for the release of several U.S. prisoners, said the travel ban would reduce Pyongyang's ability to hold Americans as bargaining chips, but would not stop it from using the tactic again.

"There are still some Americans in North Korea, mostly Korean Americans teaching at Pyongyang University," he said. "Dual citizens are particularly vulnerable. If I were one of them, I'd get out right away."

Evan Medeiros, an Asia specialist for the Eurasia Group, said a travel ban would be far more effective than the increasingly dire travel warnings issued by the State Department in the last year. The warnings have been aimed in part at deterring Americans from traveling to North Korea to slake their curiosity about the strange Stalinist state sometimes called "the hermit kingdom."

"American citizens need to hear very strong signals about how dangerous it is to travel to North Korea," he said. "It closes an important loophole to eliminate things like Otto Warmbier going to North Korea for adventure travel."

Anthony Ruggiero of the Foundation for Defense of Democracies, said the travel prohibition would be stronger if it came from the Treasury Department with steep financial fines. But he said a travel limitation is necessary to keep more Americans from being arrested by the North Korean regime of Kim Jong Un and used to extract concessions from the U.S. government.

Unlike Warmbier, none of the three Korean Americans known to remain imprisoned in North Korea entered the country as tourists. One is a businessman who formerly lived in Northern Virginia, and two had taught at Pyongyang University of Science and Technology, a school attended by the children of North Korea's elite.

The longest-held American is Kim Dong-chul, a businessman in his early 60s who was working in a special economic zone in North Korea when he was arrested in October 2015 and accused of being a South Korean spy.

Kim Sang-duk, a 58-year-old U.S. citizen also known as Tony Kim, was teaching accounting at the university. The first American to be detained since President Trump took office, he was arrested at the Pyongyang airport in April while trying to fly to China with his wife. He was accused of unspecified hostile criminal acts.

Similar vague charges were lodged against Kim Hak-song, another teacher at Pyongyang University of Science and Technology, who was arrested in May as he was about to leave North Korea.

As of May, the university employed about 40 Americans, most of them ethnic Koreans.

An estimated 1,000 to 1,300 Americans visit North Korea every year, and the loss of their tourism dollars is not expected to have much impact.

But Sung-Yoon Lee, a professor of Korean studies at Tufts University's Fletcher School, said prohibiting U.S. passport holders from traveling there suggests the United States is prepared to get tougher with Pyongyang.

"It sends the right message to North Korea, and to friends and adversaries alike, that the United States now is much more serious about enforcing sanctions and putting pressure on North Korea," he said. "The United States is now trying to galvanize the international community to do their best to enforce sanctions."