“Beautiful,” the Tony and Grammy Award-winning jukebox musical about the life and songs of Carole King, will close on Oct. 27, 2019, producers announced on Wednesday , after nearly six years on Broadway.

The production, which opened in January 2014 and features a collection of beloved songs written by Ms. King, her ex-husband Gerry Goffin and the writing partners Barry Mann and Cynthia Weil, will have played 2,418 regular performances and 60 previews at the Stephen Sondheim Theater. It will close as the longest-running and highest-grossing show in that theater’s history: Since its opening, “Beautiful” has grossed nearly $250 million.

With a book by Douglas McGrath, "Beautiful” portrays Ms. King’s origins as a young songwriter in New York, her rocky marriage to her writing partner, Mr. Goffin, and the parade of hits she wrote for the Drifters (“Some Kind of Wonderful“), the Shirelles ( “Will You Love Me Tomorrow” ), Aretha Franklin (“Natural Woman”) and later for her own chart-topping album “Tapestry.”

Over the years, the role of Carole King has been played by multiple performers. (“Beautiful” also featured Carole King herself, who surprised audiences in January when she sang the final song onstage to celebrate the show’s fifth anniversary.) Jessie Mueller, who opened the show in the role, won a Tony Award for best actress in a musical in 2014. After Ms. Mueller left in 2015 to star in “Waitress,” Chilina Kennedy took over and played Ms. King in more than 1,000 performances. Ms. Mueller’s sister, Abby, and the actress Melissa Benoist have also played the lead.