CHARLOTTE AMALIE, U.S. Virgin Islands — Jeffrey Epstein was moving forward with plans to triple the size of his residence on his private Caribbean island at the same time his lawyers were secretly hashing out a lenient deal with federal prosecutors in Florida, according to documents viewed by NBC News.

Permit records in the Virgin Islands reveal that Epstein was seeking a massive renovation to his estate on the island he owns, Little St. James — complete with a new pool, spa and underground theater — in the fall of 2007. During that same period, court documents show, Epstein's legal team was in negotiations with federal prosecutors in Miami investigating him for preying on young girls who were recruited to give him sexual massages.

The non-prosecution agreement they ultimately reached spared Epstein the prospect of spending several years in federal prison. The deal has come under renewed scrutiny after Epstein was charged earlier this month with operating a sex trafficking ring in New York and Florida in the early 2000s.

According to the trove of newly unearthed permit records, Epstein's sights were set on his island compound while he was trying to dodge the federal indictment.

In November 2007, the wealthy financier submitted a proposal to transform his 8,124-square-foot main house into a megamansion.

The plans called for the construction of a 16,747-square-foot addition configured into three wings with impressive features: a spa area on the north wing, an expansive living room connected to a below-ground theater on the west wing, and on the south wing a new kitchen and dining area, as well as two additional guest rooms, according to the proposal created by the Massachusetts-based design firm Maguire Group.

"The alterations to the existing house will include a complete gutting of the kitchen, living room, office and guest rooms 1, 2 & 3, and installation of new roof structures and interiors," the proposal says. "The terrace north of the living room will be completely demolished and a new pool will be constructed in its place."

The proposal also offered benefits beyond expanding Epstein's lavish footprint on the 70-acre island he purchased in 1998 for $7.95 million.

"New terraces will connect the master bedroom to the new pool and pool house," the plan says.

With outdoor terraces, stairs and pool, Epstein was seeking permission to expand the property encompassing his private residence to a total of 46,697 square feet — an increase of almost 20,000 square feet, the documents show.

The main residence on Little St. James, the island owned by Jeffrey Epstein in the Caribbean. NBC News

The request came at a precarious time for Epstein, who has socialized with the likes of Donald Trump, former President Bill Clinton and Britain's Prince Andrew.

Beginning in 2005, police in Palm Beach, Florida, were investigating allegations that he sexually abused dozens of girls. Federal authorities joined the investigation and interviewed victims based in the Palm Beach area, according to court documents.

But instead of charging Epstein, federal prosecutors entered into a secret deal with him in the fall of 2007 that spared him from serious federal sex crimes charges.

Instead, he pleaded guilty in June 2008 to state charges of soliciting a minor for prostitution. He spent 13-months in a Palm Beach county jail in an arrangement that allowed him to leave for 12 hours, six days a week, on work release.

It's not clear if Epstein was given the green light to move forward with all aspects of the proposal to upgrade his main residence. The records made available to NBC News at the Department of Planning and Natural Resources headquarters on St. Thomas did not specify whether he was granted a permit for the full scope of the work.

But aerial footage taken by NBC News shows a sprawling compound with expansive terraces and turquoise roofs built around a pool.

The Caribbean island estate owned by Jeffrey Epstein. Epstein purchased Little St. James in 1998 for $7.95 million. NBC News

Representatives from the Department of Planning and Natural Resources did not return a request for comment.

Epstein was released from jail in July 2009. Five months later, his company filed a new permit application seeking to further expand his property on Little St. James.

Epstein's plans included the construction of a 2,400 square-foot wood sun deck with coral stone paving in his organic vegetable garden, and a stone patio and sitting area perched on the top of the island for "observing sunsets and overlooking the sea." He also requested permission to build a 10,400-square-foot pool pavilion, a 1,320-square-foot ATV garage made out of stone and a tennis court built in a lowland area to ward off high winds.

Epstein, 66, is now locked up in a federal detention center in New York City. He's facing up to 45 years in prison if convicted on charges of sex trafficking and conspiracy. Prosecutors say he and his associates recruited dozens of underage girls as young as 14 and paid them to engage in sex acts with Epstein at his mansions in New York and Florida between 2002 and 2005.

Epstein has pleaded not guilty.