A man has been freed after being trapped in a collapsed four-metre hole of sand up in Hervey Bay on on Thursday.

The 29-year-old man was trapped for more than three hours, telling police he was chasing a lizard before the sand collapsed on top of him.

Investigators have looked into whether a stormwater pipe running underneath the hole sprung a leak and caused the sand to collapse around the man.