My grandfather would do something similar with my cat. My cat would walk up to him, and sit-down. He would grab it by the head and hold it down until he would have had enough scratch up his arms, then he would get upset and yell "Damn useless cat" The cat trotted off like nothing happened.
This would happen several times and while it would leave both annoyed, they would still do it some time later if they met again. I guess there was a weird kinship.