In the opening dialogue of Act 4 of Shakespeare's Hamlet, Gertrude tells Polonius what has happened, in response to his question about how Hamlet is:
Mad as the sea and wind when both contend
Which is the mightier. In his lawless fit,
Behind the arras hearing something stir,
Whips out his rapier, cries 'A rat, a rat!'
And in this brainish apprehension kills
The unseen good old man.
When Gertrude talks about Hamlet's madness, she is probably telling the truth. She probably does see Hamlet as mad. At the same time, since at times in her lengthy scene at the end of Act 3 she seems to understand and go along with Hamlet, it is possible that she is excusing her son's behavior, trying to lesson the blow when she gives the news to Claudius. Her description certainly does fit Hamlet's behavior, however.
Her description of the actual killing is basically accurate, although she leaves out the fact that Polonius screams from behind the arras. Again, this would make Hamlet seem all the guiltier if she were to reveal it.
Hamlet is speaking metaphorically when he cries "rat." As mentioned, Polonius screams before Hamlet strikes, and if Hamlet really thought the stirring was a rat, he'd have stomped on it or struck at the floor or something other than what he does, according to the stage direction: "[Kills Polonius with a pass through the arras.]"
Hamlet knows what he is doing when he strikes. When he asks about the king, he is hoping it was the king.
I think that she is literally telling the truth -- she is accurately describing what he said. But I do not think she is telling the whole truth.
She said that he said "a rat, a rat" and then stabbed behind the arras. And that is pretty much what he did.
However, she also says that he was mad when he did it and this, I think, is a lot less accurate. When Hamlet hears that whatever he stabbed was not a rat, he asks if it was the king. He is showing that he was hoping it was the king when he stabbed.