Man's best friend has a built-in butt compass, according to research published in the journal Frontiers in Zoology.

Scientists at the Czech University of Life Sciences found that when Earth’s magnetic field is stable, off-leash dogs prefer to poop with their bodies oriented along the north-south axis.

The researchers monitored 70 dogs of 37 breeds over a two-year period and witnessed a lot of dog pooping — for a grand total of 1,893 "deposits."

"Dogs preferred to excrete with the body being aligned along the north-south axis under calm magnetic field conditions," the study reads.

However, dogs only poop in this direction when the planet's magnetic field is stable, which is only about 20 percent of the time during daylight.

When the magnetic field is unstable, such as when Earth is hit by a solar flare, canines get confused and position their bodies in other directions.

This is the first time that magnetic sensitivity has been proved in dogs, according to researchers.

Related on MNN: