I once had a Manx cat named Cleo, and since he was of the longhaired persuasion, there were a couple of times I'd see him use the litterbox, and it would be one huge mass hanging out. I'd have to get wads of paper towels, grab him, and very carefully pull the mass of fur and used cat food out. Eventually, I'd get him completely evacuated, and then I'd be grooming him more, and giving him plenty of petromalt. We're talking major league hairball! Luckily, he enjoyed getting brushed and loved petromalt, so if I had had more discipline I would've kept him from having to have a mass of poop and fur pulled out of him.
Grooming and giving petromalt, aka laxatone, or just plain petroleum jelly, or giving them some canned pumpkin to add bulk can help prevent hairballs. That's what it sounds like your cat had. Too much hair in the belly, they can't eat because there's no room for the food. Perhaps you should get him a lion cut, or at least buzz him around the back end so it doesn't stay there. That's what Persian owners do, give them a summer cut when shedding season starts in earnest.