Jennifer Lopez has sold her Madison Square Park penthouse in New York City for $23 million, ending a seven-year effort to find a buyer, first listed the 6,540-square-foot duplex at 21 E. 26th St. for $26.95 million in 2017. Lopez bought the penthouse for $20.1 million in 2014.

The elegant residence features four bedrooms, 6½ baths, and nearly 3,000 square feet of outdoor space, including a croquet pitch, landscaped roof deck, and putting green. The building, dating to 1924, has just four units and boasts 12-foot-6-inch-high ceilings, white oak floors, and a private keyed lift. The great room has a skylight and Palladian-style windows, leading to a terrace with views of the park, Flatiron Building, and MetLife Clock Tower.

The main floor includes an open chef’s kitchen, two wine fridges, and a guest wing with three bedrooms. The upper level houses a primary suite with two spa-like baths, a dressing room, two private terraces, and a media room.