In Hamlet how did polonius die?

he was spying on hamlet, hamlet thought he was the king so he killed him