After overnight negotiations, Christie Brinkley and Peter Cook have reached a surprise settlement in their ugly divorce battle over custody of their kids, the New York Post reports.

A source tells the Post that Cook, 49, will continue their current custody arrangement: He will get their kids, Jack, 13, and Sailor, 10, every Wednesday and alternating weekends, plus alternating weeks during the summer.

According to the Post, Cook also "conceded substantial grounds on the assets portion of the divorce."

Both parties are expected to appear in court at 9:30 a.m. to finalize the deal.

Asked Wednesday if a settlement were in the works, Brinkley, 54, pressed her palms together and told reporters, "It's what I hope and pray for."

The settlement marks the end of a bitter — and embarrassing — battle for the two.

Brinkley, who broke down several times on the stand, had accused Cook of having a $3,000-a-month Internet porn habit and of destroying their 10-year marriage by having an affair with his teenage assistant.

"My world was completely shattered," she said of learning he cheated on her in 2006.

She also alleged that he had been arrested for buying drugs "at a gay truck stop."

Cook apologized for the affair and porn usage, but insisted neither affected his parenting skills.

He fired back at Brinkley, saying she had anger issues and suggested that she was trying to launch a smear campaign against him for requesting a public trial.

Asked about Brinkley's crying while on stand, Cook sniped, "Shrek was more believable." Despite the humiliation, he said the trial was "about parenting and remaining in my children's lives."

In the end, a court-appointed psychologist testified that Brinkley deserved full custody because Cook's narcissism "could cause harm" to their children.

The doctor also said that Brinkley (who has wed four different guys) needed "to start working on deeper issues," including "her choice of male figures."