Updated

A judge has sided with Brad Pitt, ruling him joint custody of his children he shares with Angelina Jolie, Fox News has learned.

The Oscar winner, 57, and Jolie, 46, have been locked in a legal battle over custody of their six kids for nearly five years. Judge John Ouderkirk, a private judge hired to oversee the case, recently issued a "detailed" ruling in which he found Jolie's testimony "lacked credibility," a filing by Pitt's team states.

The judge, ruling in Pitt's favor, "significantly modified the customary order to increase [Brad's] time with his kids," a source said.

Jolie could appeal this, said the insider, noting that court proceedings in the case mostly have been sealed.

BRAD PITT FIRES BACK AT EX ANGELINA JOLIE AFTER SHE FILED REQUEST TO REMOVE JUDGE AMID DIVORCE BATTLE

"Mostly all [Brad] wanted was to see his kids and that was the whole point," a source told Fox News.

"Brad has always been seeking the opportunity to have more time with his children and prioritized their well-being while the other side did everything to try and stop that," the insider added. 

While the case did include witness testimony, Jolie, who has previously sought to disqualify Judge Ouderkirk from the divorce case, recently criticized him for his decision to not let their children testify. She said in a filing Monday that he declined to hear evidence she says is relevant to the children's safety and well-being before issuing a tentative ruling. The documents don't elaborate on what that evidence may be.

LONDON, ENGLAND - FEBRUARY 16: Actors Angelina Jolie and Brad Pitt attend the EE British Academy Film Awards 2014 at The Royal Opera House on February 16, 2014 in London, England. (Photo by Chris Jackson/Getty Images)

A judge sided with Brad Pitt in ruling grant custody of his children, Fox News has learned. (Getty)

"Judge Ouderkirk denied Ms. Jolie a fair trial, improperly excluding her evidence relevant to the children’s health, safety, and welfare, evidence critical to making her case," according to the filing in California’s Second District Court of Appeal.

ANGELINA JOLIE CLAIMS SHE HAS 'PROOF' OF BRAD PITT'S ALLEGED DOMESTIC VIOLENCE IN COURT

The actress also said the judge "has failed to adequately consider" a section of the California courts code, which says it is detrimental to the best interest of the child if custody is awarded to a person with a history of domestic violence. Her filing did not give details about what it was referring to, but her lawyers submitted a document under seal in March that purportedly offers additional information.

Jolie sought a divorce in 2016, days after a disagreement broke out on private flight ferrying the actors and their children from France to Los Angeles. Pitt was accused of being abusive toward his then-15-year-old son during the flight, but investigations by child welfare officials and the FBI were closed with no charges being filed against the actor. Jolie's attorney said at the time that she sought a divorce "for the health of the family."

CLICK HERE TO SIGN UP FOR OUR ENTERTAINMENT NEWSLETTER

In response to Jolie's filing, Pitt's attorneys said, "Ouderkirk has conducted an extensive proceeding over the past six months in a thorough, fair manner and reached a tentative ruling and order after hearing from experts and percipient witnesses."

CLICK HERE TO GET THE FOX NEWS APP

Three of Jolie and Pitt's six children are teenagers, 17-year-old Pax, 16-year-old Zahara, and 14-year-old Shiloh. The oldest, Maddox, is 19 and not subject to the custody decision. They also have 12-year-old twins, Vivienne and Knox.

The Associated Press contributed to this report.