My cat is normally the sweetest and is super-friendly, but a few months ago he started occasionally doing this thing where his eyes go wide and he attacks. Even if you stop playing he'll bite or swipe at you, and you can't walk away. He's not vicious, so I think he's trying to play, but it's very annoying and he can break skin with his claws or bruise with his bites while in this "mode".
Sometimes he does it when I'm playing with him, or sometimes when I'm trying to get him to go away (like when I put him off my desk several times in a row).
So far what I've been doing is pick him up (and usually getting a light-medium bite in the process) and stick him in the bathroom and close the door (it's the only room I can close him into). After a few minutes I open the door and he's calm again (usually) but I'd really prefer if he didn't do this at ll. He went a year or do without ever getting in this "mode". He's a neutered male ~3 year old longhair mutt, possibly Maine Coon or Norwegian Forrest cat blood in him.