Molly, the rare "hermaphrodite" dog had undergone gender reassignment surgery.

As described by the veterinarian who discovered the Jack Russell's case back in November 2015, Molly had male testicles, which had not descended, and female genitalia with a poorly formed "vestigial" penis.

"Some folk would use the term intersex, some would say non-binary, in that she is not male or female, but the correct scientific term is that she is a male pseudohermaphrodite," Glasglow vet Ross Allan told BBC Scotland's Kaye Adams Program.

Allan asserts that Molly's case is extremely rare with only 15 similar cases documented.

As reported by Telegraph, Molly's owners, Mary and Frank Finlay, initially thought Molly was female. It is only when they noticed that she has unusual toileting behavior such as shaking her leg when urinating and rubbing herself in furniture. That was when they decided to take Molly to the vet.

According to Allan, X-ray results showed that the elements of both the male and female genitals are present in Molly and are causing her discomfort.

"What transpired was that although Molly looked to be female, her urethra followed the route as though she was a boy. She did not have a properly formed penis. She actually had the female external genitalia, as it were, but in the male formation. That was the problem. It was not normal anatomy and it was getting inflamed and so on," Allan explained.

And such, the gender reassignment was decided upon so she could live normally in comfort. She underwent surgery in June, when she was about six months old, and she has now recovered fully.

During the surgery, they have found she has testicles within her abdomen. They had to remove all her pseudo male sex organs and cut a urethral opening to allow her to pee comfortably.

Despite the surgery, Molly's owner claims Molly, who is still a she, still cocks her leg like a male dog when urinating. But at least, distress has already been removed and Molly can wiggle her tail like any other pup.