Ditto Marda.
This happens, at about this age.
But you need to address it, or it will become a bad "habit" of the child.
My kids went through that too, but are excellent in school. And they are good kids.
They are also testing limits with the parents.
So, instead of sugar coating things, for me... I TELL my kids bluntly, it is NOT ACCEPTABLE. They DO know better. They do.
So, I tell them, IT IS A CHOICE... that they either act like that or not. It is a CHOICE. But if they act like that... I will be much stricter, with them. Rudeness is not, acceptable.
So I tell them, "You redo that, or Mommy will become very... strict and you will lose privileges. YOUR choice." Then I walk away, and let them ruminate about it. IF my kids then, redo their action/attitude, I acknowledge that and say they made a good decision. I don't reward them with treats. Because, I want them to learn to CHOOSE their behavior, on their own and with their own thought processes. A child needs to learn that. To self-direct themselves.... and hence, become more self-AWARE and self-reliant. Not just doing it to get a "reward."
DO NOT argue with your child.
It will not work.
It will just makes things worse.
Also, at times, when/if my kids were like that... I go and sit by them. And I hold them, I tell them in a heartfelt way... that acting like that is mean. It is not nice, they KNOW that. They should not be treating their Mommy or anyone, like that, it hurts the other's feelings. And I talk to them, in a calm quiet manner... and tell them in a direct but heartfelt way, that being like that, is poor behavior and disappointing, but I KNOW they know better. So SHOW, me. And they do, rise up.