Madonna has hit back in defiant fashion on social media, following the conclusion of her custody battle with her ex-husband Guy Ritchie over their teenage son Rocco.

The 58 year old pop icon took to her Instagram on Wednesday (September 7th), hours after the news broke that Rocco would continue to live in London with his film director father, and said that a mother sometimes “need to be a b****”, seemingly hitting out at the terms of the agreement.

Because sometimes soccer Mom's need to be a .......,.,,........@mertalas

A photo posted by Madonna (@madonna) on

The image itself showed a queen’s crown and the word ‘b****’ underneath, and an identical picture uploaded moments later contained the caption: “and be treated like a b****”.

It came on the same day that the warring ex-couple, who also have a 10 year old son David, whom they adopted from Malawi, agreed to call off their nine-month dispute over the living arrangements of 16 year old Rocco.

According to TMZ, the resolution happened just “hours” before the pair were due to appear in court in New York to finally resolve the situation.

More: Madonna’s custody stand-off thawing as she visits son Rocco in London

“The case is settled and everyone agrees that Rocco’s needs changed and he’s going to be living with dad,” said Ritchie’s lawyer Peter Bronstein on the steps outside the court last night. “Everyone’s agreed to that and there’s no further need for any kind of a court case.”

The custody dispute began way back in December 2015, when Rocco left Madonna’s world tour to live with his dad in London. He refused to return to Manhattan for Christmas with his mother, leading to litigation behind launched quickly. The verdict went in favour of Madonna, but a warrant wasn’t issued to enforce the court order and Rocco ignored it.

She and Ritchie, 47, have been hashing it out in court ever since, with the judge in the case urging them to resolve the dispute among themselves back in March.

More: Director Lee Daniels apologises to Sean Penn over Madonna domestic abuse allegations