Jake Gyllenhaal, Lin-Manuel Miranda and Barbra Streisand have paid tribute to late musical theatre icon Stephen Sondheim.

The legendary composer and lyricist, whose works include West Side Story, Gypsy, and Sweeney Todd: The Demon Barber of Fleet Street, passed away at his home in Roxbury, Connecticut early Friday morning at the age of 91. His lawyer and friend, F. Richard Pappas, told The New York Times that Sondheim had not been known to be ill and described the death as sudden, as Sondheim had celebrated the Thanksgiving holiday on Thursday by having dinner with friends.

Following the shock announcement, stars of the stage and screen took to social media to celebrate the musical theatre great.

Gyllenhaal shared a picture on Instagram of Sondheim clapping in the audience during the curtain call on the opening night of the revival of his musical, Sunday in the Park with George, and wrote, "I am grateful to have shared time with the master and maestro of American musical theater, and to have played his George. We have lost a giant. We will miss you. Rest In Peace."

Hamilton creator Miranda celebrated Sondheim's creations on Twitter and then referred to his directorial movie debut Tick, Tick... Boom!, which was released on Netflix last week and shows Sondheim, played by Bradley Whitford, becoming a mentor to Rent composer Jonathan Larson, portrayed by Andrew Garfield.

"Future historians: Stephen Sondheim was real. Yes, he wrote Tony & Maria AND Sweeney Todd AND Bobby AND George & Dot AND Fosca AND countless more. Some may theorize Shakespeare's works were by committee but Steve was real & he was here & he laughed SO loud at shows & we loved him," he tweeted. "(And) last week, when I wrote him to say his ears must be burning from the countless Sondheim kindnesses being shared from the generations of writers he mentored, he wrote this in reply... We love you. I love you. THANK YOU."

Miranda then shared a screengrab of an email from Sondheim in which he thanked him for "the nice boost to my spirits".

Meanwhile, Streisand tweeted, "Thank the Lord that Sondheim lived to be 91-years-old so he had the time to write such wonderful music and GREAT lyrics! May he Rest In Peace," and British theatre mogul Andrew Lloyd Webber wrote, "Farewell Steve, the musical theatre giant of our times, an inspiration not just to two but to three generations. Your contribution to theatre will never be equalled."

Hugh Jackman commented, "Every so often someone comes along that fundamentally shifts an entire art form. Stephen Sondheim was one of those. As millions mourn his passing I also want to express my gratitude for all he has given to me and so many more. Sending my love to his nearest and dearest."

And Anna Kendrick, who starred in the film adaptation of Sondheim's musical Into the Woods told her followers, "Performing his work has been among the greatest privileges of my career. A devastating loss."

Sondheim was also famous for musicals including Company, Assassins, Passion, A Funny Thing Happened on the Way to the Forum, Follies, A Little Night Music and Merrily We Roll Along.

During his career, Sondheim won seven competitive Tony Awards, plus a lifetime achievement Tony in 2008, eight Grammy Awards, one Academy Award - Best Original Song for the 1990 movie Dick Tracy - and the Pulitzer Prize for Drama for Sunday in the Park with George. He was honoured with the Presidential Medal of Freedom by Barack Obama in 2015.

He is survived by his husband Jeffrey Romley.