Good evening - I'm Dr. Sara. I'm a licensed veterinarian who works exclusively with dogs and cats. I'm sorry to hear that you're having a bit of trouble with Shadow.
Truly - some cats just do not like being petted. This is their right, I suppose ;) Certainly I'd suggest a trip to the vet to be sure there's no medical problem happening such as arthritis or back pain, but these would be unlikely in a five year old cat. Likewise, I'd suggest a vet exam if this is a brand new "out of the blue" problem.
However, if this has been going on for a long time, it's likely a part of his personality and behavioral pattern. We actually have a name for this: it's called petting induced aggression. The hallmark of petting induced aggression is that cats are sociable and happy and seem to enjoy petting for a short period of time. When they are done enjoying it, though, watch out! They will give some subtle cues that they're unhappy - a tick of the tail or a twitch of the ear. Cats can be subtle in their communications. The bushy tail you're seeing indicates that he's quite upset indeed.
The most basic tenant of treating any behavioral problem is this: "If you can predict it, prevent it!" If he reacts this way every time you pet him, I would find some other way to interact with him that doesn't involve petting, like scratching his ears or just playing with a toy.
Here is a link from the ASPCA with a lot more great information :)
Please let me know what other questions I can handle for you :)