Looks like our long national nightmare--or Pamela Anderson and Tommy Lee's protracted personal one, at least--is about to end.

The fun couple-turned-embattled exes were said to be close to a settlement in the nearly yearlong battle over their two sons. As reported on Launch.com, Lee and Anderson have agreed to joint custody of their children.

Lawyers for both sides were due in a Los Angeles court Thursday, but as of late Thursday, there was no confirmation of a truce from Anderson's or Lee's camps.

Lawyers told a Los Angeles County Superior Court judge on Tuesday that the deal was (almost) done, according to the Associated Press. "I believe we're really down to language [in the agreement]," Lance Spiegel, Lee's attorney, said.

Spiegel estimated the paperwork should by signed by Monday--and that's not a day too soon for the judge, who has threatened to end the matter with a mistrial if the two sides don't make nice.

Pam Anderson started the war last October.

In a scathing 12-page opening legal volley, she described the former Mötley Crüe drummer as "a very angry, unstable man who presents a danger to others, particularly when he is using alcohol, as he is presently doing."

And, as if that weren't enough, in December 2001, she formally sued her ex-hubby for full custody of their two children, Brandon, 6, and Dylan, 4.

In court documents, Anderson accused the rocker of insisting on being "the center of attention," of timing his drinking so that he could imbibe booze and still pass drug tests and of inspiring their two sons to call her a "freak."

She also rehashed Lee's 1998 arrest for spousal abuse. (Lee pleaded no contest to a charge that he kicked Anderson. He was sentenced to six months in jail, serving four.)

Lee fired back with his own legal stack. In the documents, he said he was, too, sober--and has been for two years. He said he wasn't jealous of Anderson's new boyfriends, of whom Kid Rock is the latest. And, most key, he said he was not a bad influence on the children.

In his court papers, Lee portrayed himself as an involved dad who screens A Bug's Life for his tykes and does parent-teacher conferences. In one of those school confabs, Lee said, he learned his eldest son had begun to drop the F-bomb in class. "Brandon told the teacher he had learned the word from his mommy," Lee said in a declaration filed last December.

The back-and-forth sniping continued, with Anderson accusing Lee of allowing their sons to hop on the back of his Harley without helmets and Lee accusing Anderson of being "inflexible" on matters great (Should the kids be allowed to watch TV coverage of the 9-11 attacks?) and greater (How should we talk to the kids about the subject of death?).

Perhaps the capper came in March, when Anderson revealed she'd been diagnosed with hepatitis C, a chronic, potentially liver-destroying disease she said she contracted from sharing a tattoo needle with Lee. Lee's camp initially denied the charge outright, then regrouped and accused Anderson of trying to score points (at his expense) in the custody war.

As reported on Launch.com, a Lee rep called the 40-year-old rocker "obviously thrilled with the outcome" of the pending custody settlement.

In happier days, Lee and Anderson, now 35, were a barefoot couple, exchanging wedding vows in the sands of Hawaii in February 1995--only four days after they'd met. The two divorced in 1998.