He sprinted to the shoreline and found the two-metre long dusky shark in shallow water close to where toddlers were paddling.
The father-of-three grabbed the shark by the tail and dragged it out to deeper water. He narrowly avoided being bitten in the process when the shark lunged at his leg.
Mr Marshallsea, a football coach and referee from Merthyr Tydfil in Wales, said: "The shark nearly took my leg off in a split second -- it was that quick.
"Where this shark actually came ashore it's shallow for about five or six yards and a lot of babies and toddlers splash about there -- it could have very nasty. My instincts took over and I just grabbed the shark by the tail.
"I know it was dangerous but it almost looked beautiful -- you have got to have respect for a beautiful animal."
The shocking scene, at Bulcock Beach on the Sunshine Coast, was captured by an Australian TV news team who were filming nearby.
Helicopters and lifesavers on jet skis later lured the shark out to sea with the tide.
An Australian coastguard spokesman said: "We don't recommend manhandling sharks but this gentleman did a great job."