TORONTO -- Stage veteran William Needles, a longtime actor at the Stratford Festival who inspired Jon Lovitz's "Saturday Night Live" character Master Thespian, has died.

The festival says Needles died Tuesday surrounded by his family at a hospice in Alliston, Ont. He was 97.

Needles suffered a massive heart attack on Dec. 19, but the festival in Stratford, Ont., says his mind remained "razor sharp."

He was even said to be reciting Shakespeare -- the chorus from "Henry V" -- in hospital.

The Kitchener, Ont.-raised actor worked at the Stratford Festival for 47 seasons, was a member of the Order of Canada and taught Lovtiz at the University of California, Irvine.

On Twitter, Lovitz called it a "sad day" and praised Needles as "the kindest, nicest man" and "a great actor."

"I based (my) character Master Thespian a lot on him," wrote Lovitz. "He was the nicest teacher, ever."

The Yonkers, N.Y., native was the son of Ira Needles, founder of BF Goodrich Canada and co-founder of the University of Waterloo.

He got his start as a stage manager in Winnipeg and then as a cast member of the CBC Radio soap opera "John and Judy" in Toronto. He left the role to serve in the Second World War but eventually returned to it.

Needles joined the Stratford Festival in its inaugural season, making his debut in "Richard III." He went on to appear in more than 100 productions there.

He was also a founding member of its company as well as a co-founder of the Actors Fund of Canada.

"The Stratford Festival has lost one of its pioneers, a gifted actor and a favourite uncle. Bill Needles was the embodiment of grace and generosity. His humour, humanity and sense of fun infused his work on and off the stage," Antoni Cimolino, the festival's artistic director, said in a statement.

"Bill was a brilliant comedian who could bring the house down with laughter while appearing quite nonchalant. His work seemed effortless. His voice and manner were rich with nuance."

Cimolino also praised his role as a mentor, noting "his honesty, decency and kindness could balm almost any hurt and sooth a bruised spirit."

Needles also performed around the world, including in a Broadway production of "Next Time I'll Sing to You" with James Earl Jones and Estelle Parsons.

His film roles included Banquo in the 1961 production of "Macbeth" starring Sean Connery.

Needles is survived by his wife, Dorothy Jane Goulding, as well as five children, 15 grandchildren and three great-grandchildren.

A family funeral will be held on Saturday in Alliston, with a burial to follow at Avondale Cemetery in Stratford at a later date.

The Stratford Festival is dedicating the 2016 production of "As You Like It" to his memory.

The festival also plans to hold a celebration of his life in the spring.