Marc Anthony’s Brookville compound, which was first placed on the market in 2015, went into contract on Thursday, the home’s listing agent says.

The agent declined to disclose the sale price of the 8.5-acre property, where the Latin pop star once lived with his ex-wife, Jennifer Lopez. The home, which was on the market for $5.995 million, was first listed with another real estate agency in February 2015 for $12 million. The gated home was put back on the market in November 2015 for $9 million before Anthony cut the price by just over $2 million in July 2016. The price was slashed again in February by $900,000.

advertisement | advertise on newsday

“It’s bittersweet for [Anthony] because he loved the house dearly but he no longer had use for it,” says Andrea Attanasio of Long Island Homes of Distinction, the co-listing agent with Teresa Angelino.

Property records show that Anthony purchased the home in 1995 for $1.2 million under his given name of Marco Muniz.

The 10,000-square-foot house, with 10 bedrooms and eight full bathrooms, includes a recording studio and home theater. The property — with taxes of $125,869 — also boasts two guesthouses and a pool.

Attanasio, who says the home was not purchased by a celebrity, expects a smooth closing in the near future.

advertisement | advertise on newsday

“We had many bids on the house, and it went to the best bid with the best terms,” she says. “The buyers are very happy they’re getting a beautiful property at a great price.”