Harry Styles poked fun at his former One Direction bandmate Zayn Malik during an appearance on US TV.

Styles had the rare honour of being both the host and musical guest on long-running comedy sketch show Saturday Night Live.

During his opening monologue, the 25-year-old, seated at a piano, recalled his time in One Direction alongside Niall Horan, Liam Payne, Louis Tomlinson and Malik.

However, when it came to remembering the latter’s name, he got him mixed up with a former Beatle.

“I love those guys,” he said of One Direction. “They’re my brothers. Niall, Louis, Liam and, erm, Ringo.”

Malik departed the band in 2015, a year before they went on indefinite hiatus.

Referencing the band’s X Factor roots, Styles added: “I’m just so grateful Simon Cowell grew us in those test tubes.”

For the first of his two musical performances on the night, Styles, wearing a sequined outfit, performed a stripped back version of his latest single Lights Up, which will feature on his forthcoming album Fine Line.

He later performed another track from the album, Watermelon Sugar.

Both were well received by the audience inside Studio 8H, where SNL has been filmed since its inception in 1975.

Styles, wearing pink and blue nail varnish on his fingernails, said he was excited to show off his comedic skills before appearing in his first sketch of the night, poking fun at the shortage of chicken sandwiches at US fast food outlet Popeyes.

He also played a hapless airplane pilot in a sketch where he and his co-pilot mistakenly broadcast a smutty conversation to stunned passengers.

The final sketch had Styles as one half of a wildly inappropriate musical act at the funeral of an elderly woman.

SNL’s opening segment poked fun at this week’s impeachment hearings investigating Donald Trump, and featured Mad Men star Jon Hamm.

Next week, SNL will be hosted by actor Will Ferrell, while the musical guest will be singer-songwriter King Princess.