Image copyright PA Image caption David Bowie had previously only won four Brit awards during his career

The nominations were a showcase for the diversity of British music, but in the end David Bowie dominated the 2017 Brit awards.

The star, who died last January, was awarded best British male and best British album, for his mournful swansong, Blackstar.

His victory meant that grime artists left without any trophies, despite a breakthrough year for the genre.

However, Skepta stole the show with a blazing performance of Shut Down.

South London MC Stormzy also joined Ed Sheeran on stage for a new version of his single Shape Of You; while Emeli Sande, the soul star who started out singing on tracks by Wiley and Chipmunk, won best British female.

An average of 5.4 million viewers tuned in to watch the ceremony on Wednesday night - a slight drop from last year.

Media playback is unsupported on your device Media caption Little Mix, Emeli Sande and Rag 'N' Bone Man on winning Brit Awards.

Rag 'N' Bone Man was the other big winner of the night taking home two awards - the critics choice award and best British breakthrough act.

Image copyright AP Image caption Rag 'N' Bone Man was 'nearly speechless' at his two Brit awards

Bowie's wins were a fitting tribute to one of Britain's most influential and groundbreaking musicians.

Collecting the best album prize, his son the film director Duncan Jones spoke about the star's enduring legacy.

"He's always been there supporting people who think they're a little bit weird or a little bit strange. He's always been there for them.

"This award is for all the kooks and all the people who make the kooks," he said, referencing the song his father wrote for him as a child, from the Hunky Dory album.

Image copyright PA Image caption Coldplay's Chris Martin performed George Michael's A Different Corner

As well as honouring Bowie, the Brits paid tribute to George Michael, who died on Christmas day.

His former Wham! bandmates Andrew Ridgeley, Pepsi and Shirlie, made an emotional speech, saying: "His beautiful voice will live on forever as a gift to us all."

Coldplay's Chris Martin then sang an understated but moving version of Michael's A Different Corner, duetting with a recording of the star's own voice.

Analysis by music reporter Mark Savage

So in the end, after all the thinkpieces and positive headlines, grime artists left the Brits empty-handed.

Bowie took home two of the night's biggest prizes, best British male and best album, while Rag N Bone Man was the surprise winner of best breakthrough, beating Stormzy and Skepta.

Is it enough that grime and urban music got nominated? Or does it look like the Brits invited these stars to the party, only to slam the door in their face?

It depends on how you view the ceremony. In pure sales terms, it's the performances that matter - and Skepta's powerful, thrilling rendition of Shut Down will undoubtedly give him a massive boost. Ed Sheeran inviting Stormzy on stage is a big deal, too... A seal of approval from one of pop's biggest stars, that never felt opportunistic.

Emeli Sande's win in the best female category will be held up as proof the voters aren't colourblind. Likewise, the blink-and-you-missed-them international categories went to Beyonce, Drake and rap legends A Tribe Called Quest.

But if the awards matter (and they should), the Brits need to recognise the vigour of UK grime, not just reflect it.

Little Mix kicked off the show, carried above their dancers' heads on sparkling thrones. The girl band later won their first ever Brit, best British single, for their anthemic pop song Shout Out To My Ex.

The X Factor graduates thanked each other on stage, hinting their success hadn't been without its downsides. "If it wasn't for our friendship, we wouldn't still be going," said Jade Thirlwall.

Image copyright PA Image caption Little Mix opened the show with a silver themed performance

Katy Perry also put on a stunning performance of her new single Chained To The Rhythm, accompanied by two giant skeleton mannequins. One was wearing the red tie favoured by Donald Trump - echoing the song's lyrics, which tacitly address the political upheaval in the States.

Other performances came from Emeli Sande and US dance act The Chainsmokers, who premiered a new single featuring Coldplay, Something Just Like This, where Chris Martin threw himself into the crowd.

Adele was recognised with the global achievement award - given to the British artist with the biggest overseas success. The singer, on a break from her world tour, accepted the prize by video.

Lifting the Zaha Hadid-designed trophy, the singer joked: "Have a great night and get a bit swervy, like her."

Follow us on Facebook, on Twitter @BBCNewsEnts, or on Instagram at bbcnewsents. If you have a story suggestion email entertainment.news@bbc.co.uk.