Peter Scolari, who rose to stardom on the brilliant-but-canceled “Bosom Buddies” alongside Tom Hanks, died Friday morning at age 66 of cancer, after a two-year illness.

His death was confirmed by his manager Ellen Lubin Sanitsky at Wright Entertainment.

Scolari was a prolific actor, both on television and on Broadway. He won an Emmy in 2016 for his portrayal of Tad Horvath on “Girls,” the father of Hannah (Lena Dunham). From 1987-1989, he was nominated three times for supporting actor Emmys for his role as Michael Harris on “Newhart,” Bob Newhart’s beloved CBS comedy.

On Friday, Newhart issued a statement to Variety: “I knew that Peter was sick, but his death still comes as a great shock. We were friends and colleagues for over 40 years. Julia [Duffy] and Peter, as a vacuous couple (Michael and Stephanie), were an essential part of the success of ‘Newhart.’ In life, he was a fantastic person, and it was a joy to work together. He will be sorely missed and his passing at 66 is much too early.”

Though he was sick, Scolari was working until recently, and co-starred on the just-concluded second season of “Evil,” on which he played Bishop Thomas Marx.

The actor appeared on Broadway many times, including in “Hairspray,” “Sly Fox,” Wicked,” “Magic/Bird” — and with Hanks in “Lucky Guy” in 2013.

“Bosom Buddies” aired for only two seasons on ABC, but it set in motion both Hanks’ and Scolari’s careers. On the show, Henry (Scolari) and Kip (Hanks) — young professional New Yorkers, who work at an advertising agency — adopt drag personas in order to move into an inexpensive women-only residence, the Susan B. Anthony Hotel. They also pose as the brothers of Buffy (Hanks) and Hildegard (Scolari), in order to make their lives slightly easier, and so they can flirt with the women who also live at the hotel.

Hanks’ Kip was sarcastic and funny, and Scolari’s Henry was sweet and nervous — a perfect combination, if not for a long-running show, than for a friendship between the two actors. Before appearing on Broadway with Hanks in “Lucky Guy,” Scolari also had a cameo appearance in Hanks’ directorial debut, 1996’s “That Thing You Do!”

Whereas Hanks left “Bosom Buddies” a leading man, Scolari became a character actor. He starred on the syndicated TV adaptation of “Honey, I Shrunk the Kids” from 1997-2000, appeared as the corrupt police commissioner on Fox’s “Gotham,” and co-starred in 2016 in HBO’s TV movie “Madoff” as Peter Madoff.

Scolari’s 2016 Emmy win was practically a fluke. He wasn’t among the original nominees for guest actor that year, but after it was determined that “Veep’s” Peter MacNicol was not technically eligible for the nomination because he’d appeared in too many episodes to be considered in the category, Scolari was added to the ballot.

The win was especially sweet given, as Scolari noted backstage then, the inevitable peaks and valleys in an actor’s career.

“I’ve been at this for 42 years,” he said. “I really wanted it.” At the same time, he said the victory after four previous noms was also humbling.

“The worst thing for an actor is to buy his own hype,” he continued after winning. “I’ll be 61 years old on Monday. I want to celebrate the blessings as a human being that I’ve been given.”

Robert and Michelle King, the creators of “Evil,” issued a statement about the pleasures of working with Scolari.

“Peter was beloved on our set by the cast, the crew, and the writers not only because he was mensch and a giving actor, but because he took what otherwise was the straight man part and turned it into a comic pleasure,” it read. “He always found different ways to phrase things or find odd pauses in the middle of sentences. You could see him molding the lines looking for the laughs. Watching his dailies was always a thrill because you saw his craft in action. He worked with us right up until April 27th, and he was great in every episode. We are going to miss him dreadfully.”

Scolari is survived by his wife, Tracy Shayne, and children Nicholas, Joseph, Keaton, and Cali.

In a biography of Scolari provided by his manager, according to Shayne, “the only thing that matched his love for his family and his passion for acting was his love of being in service to others.”

Cynthia Littleton contributed to this report.