*Jennifer Lopez and Marc Anthony’s divorce has been finalized nearly three years after the singers separated. And it looks like the delay was needed so that the two parties could work out an incredibly detailed child custody agreement for their twins, Max and Emme, 6, reports Radar Online.

Los Angeles Superior Court Judge John Sandoz finalized the divorce Monday, awarding the former couple joint legal custody of their children. Court documents obtained by Radar Online show they have agreed to share the responsibility to make any major decisions about their kids, including “the decision to allow a child to enter the armed forces, the decision to allow a child to marry before the legal age … the decision to allow a child to obtain a driver’s license,” and even the decision to allow their children to work.

In the event they don’t agree, they must contact a mediator, or file a motion with the court.

Documents show that Lopez will have their son and daughter most of time, with Anthony agreeing to a deal that gives him just 7 days a month with the kids, with parameters in place to allow him to see them on holidays like Father’s Day and on their school breaks. Lopez agreed to allow him to use her nannies during those times, reports Radar Online.

The singers also agreed that no child or spousal support was necessary.

The singers also agreed to do whatever they can to shield their children from paparazzi and reporters. The judgment states both Lopez and Anthony recognize ‘‘that exposing the children to public spectacle and failing to shield the children from aggressive news organizations, photographers, etc. is not the children’s best interest.’’

In addition, “neither party shall publish or cause to be published any story, article, column, comment or book (fiction or non-fiction) describing the other party, the marriage, the dissolution of marriage proceeding or the relationship of the parties.”

Anthony filed for divorce in April 2012 but the pair separated in July 2011.

Anthony’s latest Spanish album ‘‘3.0’’ has been a hit, and he announced earlier this year that he’s working an English-language pop album. Lopez released her latest album ‘‘A.K.A.’’ this week.

A judge hearing a dispute between Anthony and his ex-wife Dayanara Torres issued a proposed ruling June 11 that if finalized would require the Latin crooner to increase his child support to their two sons, ages 10 and 13, to nearly $27,000 a month. Anthony is also required to pay $12,000 a year for Torres’ and their sons’ vacation expenses, plus medical expenses and tuition costs.

The proposed order will become official in early July unless attorneys raise new valid legal issues.