The FA have charged Keegan for his outburst, which is expected to land him with just a fine as he has not been charged by the FA previously.
The FA also confirmed that the charge relates only to the comments to Dunn, and not those said to the media (see yesterday's story).
"I shall write a letter of apology to the referee for the way I spoke to him," said Keegan.
"There were a lot worse things said publicly over the weekend but I could have articulated my thoughts better. It's the things I said in the tunnel that I'm in trouble for, and for that I will probably get what I deserve.
"It is the first time I have been in trouble, so it will be interesting to see what happens. Maybe they'll look to make an example of me but I hope not.
"I have always tried to represent football in the right way and I don't think I would deserve that."
It's a good job the charge does not relate to his media comments, as Kev refuses to say sorry for those.
"What I make no apology for is what I said to the media," he added.
"You need a strong referee at St James' Park and we didn't have one. If the FA want evidence of that, I will provide it."