The BBC’s Sport Relief raised more than £40m by the end of its live broadcast, with organisers promising a significant portion of the cash will go to those affected by the coronavirus.

The biennial charity event took place in front of a live studio audience in Salford, in defiance of the panic caused by the Covid-19 pandemic. It looks likely to be the last event of its kind for the foreseeable future, with the government on the verge of banning mass gatherings in an attempt to halt the spread of the virus.

Despite the increasingly gloomy mood gripping the country, the star-studded Sport Relief broadcast managed to raise a total of £40,540,355. That was more than 2018, when £38,195,278 was raised. The money goes to good causes in both the UK and abroad. This time around a chunk will be set aside to help coronavirus victims.

The night opened with a solemn address from one of the show’s hosts, Gary Lineker, who warned we were living in “unprecedented times”.

In another sombre early moment of the show, Lineker’s co-host Paddy McGuinness paid tribute to the late Love Island presenter Caroline Flack, who took her own life last month. Flack, 40, had worked with both Sport Relief and Comic Relief. Top Gear host McGuinness said: “She will be greatly missed by us all. We send all of our love to her family.”

A performance by Rita Ora was due to be followed by an intergenerational choir from Wales, with elderly singers teaming up with schoolchildren. However, it was decided the older performers would stay in Wales as a precaution against the coronavirus.

There were sketches throughout the show including a parody of the BBC’s award-winning drama Killing Eve, entitled Killing Steve.

Police drama Line of Duty was also parodied, with the show’s stars Vicky McClure, Adrian Dunbar and Martin Compston all appearing.

Meanwhile BBC Radio 2’s Jo Whiley, the Rev Kate Bottley and Richie Anderson were given a heroes’ welcome after raising more than £500,000 by completing three triathlons in three days.

Poignant films were shown throughout the show, highlighting how donations change lives in the UK and around the world. Recipients of the cash include people who rely on homeless centres, food banks, domestic violence shelters, isolated older people and refugees.