More than £27m was donated during the three-hour event, with the government promising to double the total.
The show saw Children in Need and Comic Relief join forces for the first time.
Peter Kay, Catherine Tate and the Little Britain duo also took part - as did the Duke of Cambridge, who appeared in a surprise sketch with Stephen Fry.
Prince William was then joined by the Duchess of Cambridge and their children to lead the weekly Clap for Carers.
Ten actors who have played the lead role in Doctor Who over the past 50 years recorded a message of thanks for real doctors and health workers.
"Tonight, we have all come together for one important reason," said the actors, who ranged from Tom Baker to Jodie Whittaker.
"To praise, salute and give heartfelt thanks to real-life, special doctors, nurses and everyone working on the front lines in our NHS and care homes and hospices."
Dawn French revived The Vicar of Dibley, who delivered a message to viewers. "Life goes on, and this will pass," she said. "It's right, really, that we shouldn't dwell too much on the sadness, but try and think about all the happiness."
She added: "Please be safe. Be kind. Eat chocolate. Praise the Lord. And praise the NHS."
Matt Lucas and David Walliams did Little Britain on TV for the first time in a decade, while Miranda Hart performed a virtual sketch with her co-stars before reflecting on the current "strange time".
She said: "Much like your nan's Christmas cake, there are going to be tough moments and parts that are hard to swallow, but we'll get through it.
"Remember, it's OK if you're struggling, it's OK if you're bored. It's OK if you're OK. It's OK if you're not OK. Be kind to yourself, be kind to others, and, remember love wins."
The money will go to causes that support vulnerable people around the UK whose lives have been affected by the coronavirus pandemic.
The programme also celebrated "the acts of kindness, humour and the spirit of hope and resilience that is keeping the nation going".
Catherine Tate's schoolgirl Lauren gave her teacher - played by David Tennant - a typically hard time as he tried to remotely educate her.
Kay made a rare appearance to unveil a new video for (Is This The Way To) Amarillo featuring key workers and members of the public, while the stars of EastEnders took part in an ill-fated Zoom quiz.
Joe Wicks made an appearance, while Joe Sugg attempted to cut the hair of his girlfriend and former Strictly Come Dancing partner Dianne Buswell.
The show also included the premiere of the video for a charity single featuring stars like Dua Lipa, Chris Martin and Ellie Goulding.
They - along with the likes of Jess Glynne, Paloma Faith and Rag 'N' Bone Man - have recorded a cover of Foo Fighters' 2003 track Times Like These, and were joined by the band's frontman Dave Grohl.
"I came in last minute after they were almost all finished, and it is amazing," the US rock star said.
Thursday's programme was hosted by Matt Baker, Zoe Ball, Sir Lenny Henry, Paddy McGuinness and Davina McCall.