Robin Thicke and Paula Patton have ended their vitriolic custody battle for their 7-year-old son, Julian.

WireImage

TMZ reported that legal documents were filed that indicated the boy will split time between Robin and Paula. Under terms of the agreement, Robin will get his son Monday through Wednesday, whereas Paula gets Julian Wednesday through Friday. They will alternate weekends.

They have also decided on a holiday schedule and have agreed to share expenses.

The news comes one day after Robin's girlfriend April Love Geary announced that they are expecting.

"Robin and I are very excited to share with you all that we're having a baby! The due date is March 1st, Alan's birthday! ❤️," she wrote on Instagram in Aug. 17.

Both Robin and Paula have to be relieved that the battle is finally over.

WireImage

The former couple had been waging war against each other over custody of their son for years, with both Paula and Robin accusing the other of violating agreements or restraining orders.

On Feb. 23, Paula accused her ex of tampering with a court order, claiming he deliberately tried to get her arrested in front of their son. In the same filling, she also suggested that Robin tried to gain favor with a DCFS monitor with an expensive sushi dinner.

WENN

A week prior, Paula refused to turn over their son at a park and said Robin violated a restraining order by coming too close. Police were called, but no arrests were made.

In late January, a judge granted a restraining order against Robin in the wake of concerns that he'd abused Julian and ordered him to stay away from his son, Paula and her mother.

Robin has admitted to spanking his son, but has denied he's abused him.