Former CIA director David Petraeus and Gen. John Allen intervened last September in a custody battle that Jill Kelley's twin sister was involved in, court documents revealed.

Both Allen and Petraeus wrote letters in September 2011 to the District of Columbia Superior Court supporting Natalie Khawam in her custody fight for her son, as she sought to gain more visitation rights. Their involvement in the custody battle prove how the Tampa socialites developed close relationships with top military officials.

"In light of Natalie's maturity, integrity and steadfast commitment to raising her child, I humbly request your reconsideration of the existing, mandated custody settlement," Allen said in his letter, according to The Huffington Post.

However, Superior Court Judge Neal Kravitz sided with Khawam's ex-husband, saying the following:

"Ms. Khawam appears to lack any appreciation or respect for the importance of honesty and integrity in her interactions with her family, employers and others with whom she comes in contact." 

He also told Khawam to pay her ex-husband's legal bills amounting to $350,000, according to the news report. 

Kelley is at the center of the scandal involving Petraeus and his biographer Paula Broadwell. U.S. officials discovered that Kelley received harassing emails from Petraeus' mistress, Broadwell, and additionally that she was engaged in "inappropriate communications" with Gen. Allen. Officials said they were investigating thousands of emails and other communications between the two. 

Allen is the top U.S. commander in Afghanistan. He denied having a sexual relationship with Kelley, according to Metro.

Kelley and her twin sister grew up in Philadelphia to Lebanese immigrants, according to ABC News. After Kelley married and moved to Tampa, Fla., with her husband, Khawam went to live with them and their three children in their $1.5 million Bayshore Boulevard home.