From your description, it sounds like your kitty is experiencing a problem with his anal glands. These glands are located on either side of the anus, under the skin. If the fluid within becomes infected, impacted or abscessed, it must be treated by the vet, asap, before it worsens and an anal gland may rupture. The vet will usually empty or 'express' the glands to help him feel more comfortable. If an infection is found, he will be placed on antibiotics. Here is more information:
I hope all will be well with your furry boy and he's feeling much better, very soon!
Please be so kind as to rate my answer with positive feedback from the ratings box at the top of your page; that is the only way I receive recognition from the website for my effort and assistance. Thank you very much!
Providing a positive rating will not end our conversation, should you need me for any follow-up. Simply click 'Reply to Expert' for clarification and/or additional information, if needed, at no additional cost.
Please don't hesitate to request me by name, for any future questions; just type: "For Cher Only" to begin your post.
Bonuses are always welcomed.