Last week, Japanese Prime Minister Shinzo Abe fulfilled an oft-repeated wish to visit Tokyo’s Yasukuni Shrine while in office. In Shinto belief, the shrine houses the souls of millions who died in the service of the Japanese Empire. Abe has expressed regret that he did not visit the shrine during his last stint as prime minister, from 2006 to 2007.

You’d think a visit to such a shrine by a sitting prime minister would be entirely proper, like an American president visiting Arlington National Cemetery. Abe’s visit has caused great controversy, however, as Abe surely knew it would. Among the souls commemorated at the shrine are a thousand convicted war criminals who fought for Japan in World War II, including wartime Prime Minister Hideki Tojo. China and Korea, which both suffered greatly at Japan’s hands in that war, deeply resent official visits to Yasukuni and, naturally, objected to Abe’s visit. So, unusually, did the United States, which expressed disappointment “that Japan’s leadership has taken an action that will exacerbate tensions with Japan’s neighbors.” Walter Russell Mead does a good job explaining the diplomatic implications.

For his part, Abe said he had not intended to offend Japan’s neighbors or send a crypto-imperialist signal. He did not visit Yasukuni to honor war criminals, he insisted, but to express to the souls housed there his determination “to create an age where no one will ever suffer from tragedies of wars.” In addition, Abe’s spokesman stressed that the prime minister had visited the shrine, and made a donation, strictly as a private citizen exercising his “religious freedom.” This last part is important for purposes of Japanese law. According to the Japanese Supreme Court, the constitutional “separation of state and religion” forbids officials from making financial contributions to Yasukuni for use in Shinto ceremonies.

So, is everything clear now? It was crucially important for Abe to visit Yasukuni while in office–but strictly in an unofficial capacity. A very lawyerly distinction, but one unlikely to persuade anyone in China or Korea. Maybe not even in Japan.