Former NBA star Ralph Sampson has agreed to serve two months in jail and pay more than $300,000 in past and future child support.

The agreement comes two days before Sampson is scheduled to go on trial to face federal charges of mail fraud, perjury and nonsupport. It concludes a legal saga that began in 2003 when federal authorities charged Sampson with failing to support two of the eight children he has with five women.

Sampson, who was college player of the year for three consecutive seasons at the University of Virginia, is scheduled to appear before a federal judge in Richmond on Thursday morning to finalize the settlement.