Through some random act of scheduling fate, both President Obama and Justin Bieber were in Japan on Wednesday. Guess who committed a faux pas that insulted all of China? (Hint: definitely Bieber).

On Tuesday Bieber posted photos of himself visiting the Yasukuni Shrine in Tokyo on Instagram, with the caption: "Thank you for your blessings." The problem is, the shrine is extremely controversial outside of Japan. As The Japan Times explains, "Some nations see the shrine as a symbol of Japan’s wartime aggression and visits by Japanese lawmakers and Cabinet members have aggravated diplomatic tensions with China and South Korea." That's probably because, among the 2.5 million Japanese men, women, and children honored by the shrine are 14 Class A war criminals, as the Washington Post's Adam Taylor notes. "For many in China, Korea and other Asian nations, Yasukuni represents the worst of Japan's imperial militarism," Taylor writes. 

Bieber deleted the photos and apologized, writing “while in Japan I asked my driver to pull over for which I saw a beautiful shrine. I was mislead to think the Shrines were only a place of prayer. To anyone I have offended I am extremely sorry. I love you China and I love you Japan,” he wrote. 

Meanwhile, Obama was in Japan as part of his weeklong trip to Asia to increase America's presence in the region. The president didn't insult millions with an egregious mistake, but China is mad at him, too. While in Japan, he said that the Diaoyu islands — which both China and Japan claim — would be covered by the mutual security agreement between America and Japan. "The so-called security alliance between the US and Japan is a bilateral arrangement made during the cold war period, and it should not be used to damage China's sovereignty and legitimate interest," foreign ministry spokesman Qin Gang said, according to the South China Morning Post. 

An article from the Chinese news agency Xinhua argued that "if Japanese politicians try to antagonize China and at the same time force Obama to take a side in the row, they may well lose their bets." Several English-language Chinese sites didn't mention the Bieber incident, but Xinhua noted that "a right-tilting Japan, with (Prime Minister Shinzo) Abe at the helm, has been busy with whitewashing its wartime aggression against its neighbors, raising severe concerns in China and South Korea." 

Obama, at least, had a nice enough reception in Japan. The lead image on several Japanese sites features his visit with Minister Abe to the Sukiyabashi Jiro sushi restaurant.