Joe Masteroff attends the "She Loves Me" press preview on Jan. 21, 2016 in New York City. (Photo by Mike Pont/WireImage)

Librettist Joseph Masteroff, known for writing the books of musicals “Cabaret” and “She Loves Me,” died on Sept. 28 at the age of 98.

Masteroff made his Broadway debut as a librettist in 1959 with the play “The Warm Peninsula.” Producer-director Hal Prince saw the play and tapped Masteroff to write adapt a Hungarian play into “She Loves Me.” The musical, with music by Jerry Bock and Sheldon Harnick, was nominated for five Tony Awards in 1963 and has since been revived twice on Broadway.

Prince later chose Masteroff to adapt the book for the 1966 “Cabaret,” which won eight Tony Awards, including one for Masteroff’s book, and has since had three Broadway revivals.

“Today we deeply mourn the loss of our friend Joe Masteroff, one of the 20th century’s masters of the Great American Musical. His She Loves Me and Cabaret helped shape our theater, and we were honored to present them both on Broadway. Joe was a close collaborator, a legendary wit, and a dear friend. Our thoughts and prayers are with his friends and family,” Todd Haimes, artistic director of the Roundabout Theatre Company

Masteroff also wrote “70, Girls 70,” another John Kander and Fred Ebb musical, which came to Broadway in 1971, as well as “Georgia Avenue,” “Paramour,”  “Desire Under the Elms,” “Six Wives” and “Anna Christie.”

Born on Dec. 11, 1919 in Philadelphia, Masteroff graduated with an English degree from Temple University and later served in the United States Army during World War II. After the war, he took free classes at the American Theatre Wing’s Professional School, launching his foray into playwriting.

He is survived by his niece, Judith Weiner of Boca Raton, Fla.