Justin Bieber wishes Anne Frank could have survived the Holocaust — and then purchased his albums.

The 19-year-old pop star raised eyebrows by penning an odd, self-obsessed tribute to the tragic teenager, who kept riveting diaries of the two terrifying years her family hid from the Nazis in the cramped attic apartment above a warehouse in her native Netherlands.

“Truly inspiring to be able to come here,” Bieber, 19, wrote in the guest book at the Anne Frank House, the hiding place-turned-museum in Amsterdam.

“Anne was a great girl. Hopefully she would have been a Belieber” — slang for his fans.

Bieber was playing near Amsterdam and decided to visit the solemn, historic site on Friday, museum spokeswoman Maatje Mostart said yesterday.

Collaborators eventually tipped off the Nazis, and the 15-year-old died in 1945 at a concentration camp.