Madonna and Guy Ritchie have reached a settlement in their bitter custody battle over their 16-year-old son Rocco.

The divorced singer and director have been engaged in a dispute over the custody of their teenage son for nine months and have now come to an undisclosed agreement.

Details of the settlement have not been released and it is not known which parent Rocco will reside with.

The dispute began in December 2015, when Rocco remained in London with his father after visiting the UK on Madonna's world tour. He refused to return to the US with his mother for Christmas.

Madonna and Ritchie took the dispute to the courts, and in December a judge ruled that Rocco should return to his mother's custody, but did not issue a warrant to enforce the order.

The teenager has since remained in London with his father and enrolled in a school.

In March, a London judge urged the former couple to resolve the matter amicably. High Court Judge Alistair MacDonald said: "At the root of these proceedings . . . is a temporary breakdown in trust. I renew, one final time, my plea for the parents to seek, and to find, an amicable resolution to the dispute between them."

Ellen Sigal, a court-appointed lawyer for Rocco, said that the dispute was causing him stress. 

"It's been a very difficult time for him," she said in court. "We hope to put an end to this as soon as possible without exposing him to more litigation, press innuendo, any of that kind of thing."

After the ruling Madonna responded on Twitter and Instagram with a series of posts about being a mother.

Posting a photo of herself in a black hoodie, with an image of a crown over her head and the word "bitch" scrawled across her front, she wrote: "Because sometimes soccer moms need to be a..........". A follow up post carried the words "and be treated like a Queen".

In March, Madonna became overcome with emotion while dedicating the song La Vie en Rose to her then-estranged son.

She told the crowd: "That is my son, who I mentioned earlier. He is actually 15 and it's true, there is no love stronger than a mother for her son.

"And, if I talk about him too much, I might cry. But I would like to dedicate this song to him. It's a love song for a man, but I know he'll be one, one day. I hope he hears this somewhere and knows how much I miss him."

Madonna spoke about her then-estranged son Rocco during performances

Madonna and Richie divorced in 2008. They also have a 10-year-old son David, who they adopted from Malawi. Madonna is also mother to two other children, Lourdes, 19 and Mercy James, 9.

The Lock, Stock and Two Smoking Barrels director has now remarried, tying the knot with model Jacqui Ainsley last year. They have three children together.