Hamlet kills Polonius in act 3, scene 4 of William Shakespeare's Hamlet because he believes him to be King Claudius, the man who killed Hamlet's father and against whom Hamlet spends the entire play seeking revenge.
The scene is set within Queen Gertrude's closet, and Polonius is there eavesdropping on the conversation because he, like many others in the castle, believes Prince Hamlet to be descending into madness. Polonius hides behind a curtain so as not to be seen. Hamlet, for his part, believes he and his mother are alone and takes the opportunity to confront her about the death of his father and her subsequent marriage to his uncle. The confrontation grows violent as Hamlet becomes more and more agitated, and Gertrude cries for help. Polonius finally makes his presence known, trying to help his queen, but before he can get out from behind the curtain, Hamlet, already enraged and believing him to be Claudius, stabs Polonius to death.
When the curtain is drawn back and Polonius's body is revealed, Hamlet regrets his rash actions:
Thou wretched, rash, intruding fool, farewell!
I took thee for thy better
Throughout the first three acts, Hamlet struggles to act on the suspicion of his uncle's villainy, and then when he finally does, he acts rashly, and the wrong man pays for Claudius's crimes.