She may have just lost the custody battle for her son Rocco.

But in truly defiant style Madonna took to social media on Wednesday as she hit back, writing that sometimes a mother 'need to be a b****'.

Sharing a series of pictures hours after it was revealed Rocco would live with his father Guy Ritchie in London, the singer, 58, appeared to take a swipe at the decision and her detractors.

Scroll down for video

'Sometimes Moms need to be a b****': Madonna posted a defiant set of imaged just hours after her ex, Guy Ritchie, won the bitter custody battle for their son Rocco

In the pictures (shot by Mert Alas) shared on social media, the Vogue singer can be seen in a black hoodie with a crown drawn atop her head above the words 'Queen' and 'B****'.

Posting the photos to both Instagram and Twitter, she seemed to take a thinly veiled swipe at the days events.

Next to the one reading 'B****', she quipped: 'Because sometimes soccer Mom's need to be a...

The caption attached to the 'Queen' image read: 'And be treated like a...'

He's gone to dad: Sharing a series of pictures hours after it was revealed Rocco would live with his father Guy Ritchie in London, the singer, 58, appeared to take a swipe at the decision

A message? In the snaps (shot by Mert Alas) shared on social media, the Vogue singer can be seen in a black hoodie with a crown drawn atop her head above the words 'Queen' and 'B****'

Her posts came just hours after it was revealed Guy, 47, had won the bitter nine month custody battle he has been entrenched in with Madonna over where their son should live.

The Sherlock Holmes director reached a settlement with the pop star hours before they were due in court in New York on Wednesday.

Speaking outside the court Guy's lawyer, Peter Bronstein, said that the 16-year-old-year-old would continue to live with his father in London.

According to Page Six, Bronstein said: 'The case is settled and everyone agrees that Rocco’s needs changed and he’s going to be living with dad.

Mother loses out: The 47-year-old director reached a settlement with the pop star, 58, hours before they were due in court in New York on Wednesday

'Everyone’s agreed to that and there’s no further need for any kind of a court case.'

Court spokesman Lucian Chalfen confirmed Madonna and Guy had reached a settlement, which was filed on Tuesday.

Madonna's attorney declined to comment on the matter at the time.

MailOnline has contacted representatives for both the British director and the American pop star for comment on the matter.

Dad's rules: Speaking outside the court Guy's lawyer, Peter Bronstein, said that the 16-year-old-year-old would continue to live with his father in London

Though court documents obtained by TMZ claimed the exes were scheduled to attend another hearing on Wednesday but did indeed resolve their differences 'hours before' the hearing.

The custody disagreement began in December 2015 during a falling out between Rocco and his musician mother when he abandoned her Rebel Hearts tour.

Heading to London after fleeing the European leg of his mother's tour, the teenager spent Christmas with Guy and his wife Jacqui - later refusing to return to America to star the school term in January.

'The case is settled and everyone agrees that Rocco’s needs changed and he’s going to be living with dad': Bronstien said that both parties had agreed it was in Rocco's best interests

The website claims that Madonna thought Guy 'had poisoned her son against her' and, 'as the disciplinarian [parent], she felt guy was way too permissive'.

The terms of their agreement remain confidential, but it is understood that Rocco will be schooled in London, with regular visits from his mother.

The parents entered into a legal battle at the end of 2015, when the teenager ignored a court order to fly back from Ritchie's London home to live with her in New York.

Carefree: The disagreement began in December 2015 during a falling out between Rocco and his musician mother when he abandoned her tour to live with the Snatch director in London

News that the pair were nearing a deal broke in June when the New York hearing was delayed for a second time.

The Material Girl singer and her ex-husband were due to appear before a judge at Manhattan Supreme Court but it was similarly adjourned hours before.

During the last hearing in New York, Madonna's lawyers claimed that Ritchie taught his son to disrespect the law by refusing to return him to his mother.

Judge Deborah Kaplan scolded both parties and told them to resolve their differences for the sake of Rocco.

In happier times: Madonna and Guy (here in 2000) ended their marriage in 2008 after eight years together

Her family: Madonna has a daughter Lourdes Leon (left) and a son David (bottom) as well as Rocco (right) and daughter Mercy (not pictured)

In March, at the High Court in London, Mr Justice MacDonald told the former couple that they risked ruining what was left of Rocco's childhood if they carried on feuding.

The judge also ruled that the English proceedings could be halted, paving the way for a potential agreement in the New York court.

The transatlantic custody row has reopened old wounds from their divorce and put Madonna at the center of a public battle.

Madonna and Guy - who remarried in 2015 has three of children under five with Jacqui - divorced in 2008 after eight years of marriage.

A family affair: On Tuesday, Madonna posted a picture of her two children David (left) and Mercy (right) as they returned to school

Though Madonna has a daughter, Lourdes Leon with ex Carlos Leon, and two adoptive children, David and Mercy; Rocco was their only child.

During the most recent dispute, Madonna reportedly hired private detectives to spy on Rocco, while Ritchie launched a parallel legal action in London's High Court.

The row began when Rocco left his mother's Rebel Heart world tour when she reportedly confiscated his mobile phone, and he subsequently refused to return home with her to the States.

Rocco spent Christmas in London with his father, who is the director of films including Lock, Stock And Two Smoking Barrels, and has largely been living with him ever since.

Happy birthdays: Recently, Rocco and Madonna have celebrated their 16th and 58th birthdays, respectively, together

Stronger than ever: The pair have successfully built bridges

Show of unity: Rocco bonded with his sister Lourdes Leon and Madonna as they went to a performance of off-Broadway show Sleep No More wearing masks in keeping with its film noir theme

In March, Madonna told an audience in Auckland that accepted that she had ‘lost the battle,’ breaking down as she told them: 'There’s no love stronger than a mother for her son.'

As soon as the Material Girl singer's worldwide tour concluded that month, she hopped straight on a plane to the UK to patch things up with her eldest son.

As the row unfolded Madonna made a series of swipes at her former husband in public and on social media.

Ritchie's second wife also posted a picture on Christmas day of Rocco at their wedding, in what was seen as a veiled swipe at Madonna.

Taking a swipe: Ritchie's second wife Jacqui (pictured) seemed to take a swipe at Madonna when she posted a picture of Rocco at their wedding on Christmas day, when they he was with them instead of Madonna

Though more recently, in April, Guy was seen to put in the time to repairing his bond with Madonna and was spotted taking wine around to her London home as a peace offering.

Madonna has also invested time into proving to Rocco that she can be a more relaxed parent.

Later that month, after pictures of the teenager claimed to show Rocco 'drinking and smoking under a bridge' she treated him to a late-night, sold out performance of stage show You Me Bum Bum Train in London.

Family trip: Rocco recently joined Madonna and her son David on an emotional family trip to his place of birth, Milawi in Africa

He also bonded with his half-sister Lourdes Leon at a performance of off-Broadway show Sleep No More.

She also took him away on a special trip to Milawi in Africa, where David and Mercy were born, this July to bring the whole family together.

In August, Madonna made sure that Rocco was sufficiently spoiled on his 16th birthday, too.

The Mail On Sunday revealed that Madonna had spent £50,000 on a private jet to fly Rocco and some pals to New York to celebrate his sweet 16.