SEOUL, South Korea — North Korea said Monday that it planned to indict and try two Americans it has held on charges of committing “hostile acts” against the country, just a day after it fired two ballistic missiles off its east coast, flouting a United Nations ban on the country’s testing of such missiles.

The North’s official Korean Central News Agency said of the Americans, Matthew Miller, 24, and Jeffrey Edward Fowle, 56, “Their hostile acts were confirmed by evidence and their own testimonies.”

Mr. Miller was detained for his “absurd” behavior after he tore up his tourist visa and demanded asylum upon arriving in Pyongyang, the North Korean capital, on April 10, according to state news media there. The arrest of Mr. Fowle, of Miamisburg, Ohio, was confirmed in early June when North Korea accused him of perpetrating “activities that violated the laws of our republic, which did not fit his stated purpose of visiting our republic as a tourist.”

The missile test came four days before President Xi Jinping of China is scheduled to visit Seoul in his first trip to the Korean Peninsula as Beijing’s leader.