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

Madonna, 58, and Guy, 47, have been locked in a legal dispute since December, after Rocco defied a court order to fly to New York to be with his mother.

In March the exes were urged by a judge to seek an amicable resolution for the sake of their son.

Hours before they were due to appear in court on Wednesday, the pair are said to have submitted documents saying they had worked things out.

Madonna and Rocco (Image: Instagram)

Rocco has been living with his dad in London (Image: FameFlynet)

TMZ reports that terms of the settlement are confidential, but it's likely that Rocco will return to school in London and see his mother frequently.

Rocco was pictured enjoying a birthday break in Havana, Cuba, with Madonna in August.

Madonna and sons Rocco and David (Image: Instagram)

Pictures shared on social media showed Rocco presenting his mum with a birthday cake, as she tenderly kissed him on the cheek.

They were also seen dancing in a club, with Madonna beaming with pride as her son twirled her around the dancefloor.

Video Loading

Video Unavailable

Click to playTap to play

The video will start in 8Cancel

Play now

It was previously claimed the singer - who also has children Lourdes, 19, and Mercy and David, both 10, had sought advice from a specialist in teenage psychology in a bid to improve her bond with Rocco.

We have reached out to representatives for Madonna and Ritchie for comment.