The zoo in the northern city of Kushiro swapped an orangutan for a polar bear cub in January 2005, hoping it would eventually produce offspring with a female bear called Kurumi.
The cub, named Tsuyoshi after the popular baseball slugger Tsuyoshi Shinjo, reached the reproductive age of four last December.
"Even though the rutting season came in spring this year, Tsuyoshi didn't show mating behavior such as chasing after a female bear," said zookeeper Hiroyuki Kubono. "We thought it might be because Tsuyoshi was still too young."
But suspicions deepened when Tsuyoshi was seen urinating just like Kurumi.
"We realized it's really odd," the zookeeper said.
The zoo sent some of Tsuyoshi's hair for a DNA test, the results of which suggested "he" was really a she.
Just to make sure, earlier this month the zoo anesthetized the bear and directly checked its body, said Kubono, adding: "It was female."
The zoo wants a male for mating and is considering swapping Tsuyoshi, but Kubono said she is hugely popular with visitors.
"Tsuyoshi came here when she was a cub and people just love her," he said
It is not an isolated case: Tsuyoshi's "brother," who was adopted by another zoo and turns three this year, has also turned out to be female.
Why didn't they check for which sex it was when they swapped to make sure they were getting what they wanted? It would be like not counting money and taking someone else's word.