SEOUL, South Korea — A 24-year-old American tourist who said he was seeking shelter in North Korea has been detained there for more than two weeks and is being held on charges of a “gross violation of its legal order,” the country’s official Korean Central News Agency reported on Friday.

But the circumstances of the detention may be in dispute. A travel agency in New Jersey says that the man, whom it identified as Matthew Miller, was on its tour to the North and that he was being held “on claims of seeking asylum.”

The North Korean announcement was made late Friday, while President Obama was in South Korea on a state visit.

The news agency said the American was being held for his “rash behavior” while passing through customs after arriving in North Korea on April 10. According to the report, the American tore his tourist visa, shouting that he entered the North “after choosing it as a shelter.”