Two Japanese tourists in their 20s were detained for two weeks in China, then deported, for taking photos showing exposed buttocks at the Great Wall, local media reported.

The incident at the World Heritage site near Beijing concerned a man who showed his bottom and a woman who took photos, NTV and other Japanese media outlets reported on Thursday.

The Embassy of Japan in China said Friday it "confirmed on Jan. 3 that two Japanese nationals were detained by local authorities at the Great Wall."

They "were subsequently released and returned to Japan during January," it said in a statement.

The tourists were detained on the spot by security guards and held for around two weeks, the reports said, citing sources.

Exposing the lower half of the body in a public place is against the law in China, according to the reports.

The tourists reportedly told the Japanese embassy they did it as a prank.

"Out of protection for individual privacy," the Japanese embassy declined to comment on specific details, including whether the tourists will be barred from traveling to China or face additional punishment such as fines or jail time.

The reports sparked outrage in China, where memories of atrocities committed during Japan's colonial occupation of the country in the 1930s and 1940s still inspire strong feelings.

A hashtag translating to "Japanese man and woman detained for indecent behavior at the Great Wall" had been viewed over 60 million times on the social media platform Weibo by Friday morning.

Many top-liked comments blasted the tourists for the act, with some using hateful language toward Japanese people.