North Korea says it has the right to “ruthlessly punish” US citizens who have been detained for crimes against its government.

The Hermit Kingdom announced Thursday that it would be exercising that right after revealing earlier this week it had taken a fourth American into custody.

“Recent Americans detained are being interrogated by relevant legal authorities for criminal acts against the Republic,” the North’s KCNA news agency said.

“It is an exercise of the legitimate right of a sovereign state to deal with the criminals according to its law,” they explained. “DPRK will detect and frustrate every anti-DPRK plot of the dishonest hostile elements and ruthlessly punish the criminals and thus reliably defend its state and social system.”

Kim Hak Song — a Korean-American who taught at the Pyongyang University of Science and Technology — was arrested by the North Koreans last Saturday for “hostile acts”

Officials in the communist country have not elaborated, though, on exactly what he did.

Kim Sang Duk, also known as Tony Kim, reportedly was taken into custody two weeks earlier and accused of attempting to overthrow the government. He is also a professor at PUST.

Kim Dong Chul, who is a naturalized US citizen from South Korea, was convicted in April 2016 of being a spy and sentenced to 10 years of hard labor.

Otto Warmbier, a US college student, was detained three months before that for stealing a propaganda poster. He was sentenced to 15 years of hard labor following a one-hour trial.

The State Department has said it’s fully aware of the arrests.

“The security of US citizens is one of the department’s highest priorities,” a spokesperson said earlier this week. “When a US citizen is reported to be detained in North Korea, we work with the Swedish embassy in Pyongyang.”

With Post wires