Bieber, 20, posted a picture on social media of himself visiting Tokyo's Yasukuni Shrine with the heading, "Thank you for your blessings".
The picture was later deleted, although it was republished elsewhere on the Internet, including by a Bieber fan group, and drew criticism from South Korea and China.
The shrine honors 14 Japanese leaders convicted as war criminals after World War Two along with Japan's war dead, and visits to the shrine by Japanese politicians anger victims of Japan's past aggression, including South Korea and China.
Chinese officials have compared Japanese politicians' visits to the shrine to the idea of German politicians laying flowers on Hitler's bunker.
The subject of Yasukuni is especially touchy this week, when about 150 lawmakers visited and Prime Minister Shinzo Abe made a ritual offering to mark the shrine's annual spring festival.
Bieber later said he had visited Yasukuni by mistake after spotting a beautiful shrine and asking his driver to stop, believing it was "only a place of prayer".
"To anyone I have offended I am extremely sorry," he wrote on his Instagram site. "I love you China and I love you Japan."
Chinese Foreign Ministry spokesman Qin Gang earlier said he hoped Bieber had learned something from his visit.
"I hope that this Canadian singer, after visiting Yasukuni Shrine, can have an understanding and knowledge of that period of militarism of Japan's history of invasion," Qin said.
Bieber is popular among some in China, and has performed there, although his popularity does not approach that of the Hong Kong and Taiwan stars many young Chinese idolize.
Earlier, some people took to China's Twitter-like Weibo to register their displeasure, with one writing: "We should run him out of Asia for this."
South Koreans flooded Twitter with angry comments that people like Bieber should not be allowed to perform there.
Bieber has been visiting Japan this week with his mother, according to postings from both on social media.
He faces a May trial in Miami on charges of driving under the influence, resisting arrest and using an expired license after police say he was caught drag racing in Miami Beach.