MANCHESTER (AFP)

Manchester United secured Champions League football next season as Kobbie Mainoo's strike earned a thrilling 3-2 victory over old rivals Liverpool on Sunday.

United were 2-0 up inside 15 minutes through Matheus Cunha and Benjamin Sesko, but imploded after the break to allow Arne Slot's men to level with goals from Dominik Szoboszlai and Cody Gakpo before Mainoo secured the win.

A return to Europe's elite competition after a two-year absence and another big win furthers Michael Carrick's case to continue as United boss next season.

Mainoo has embodied the upturn in United's fortunes since Carrick took charge in January.

Overlooked by Ruben Amorim, the England midfielder earned a new five-year contract this week and celebrated in style with a cool finish from the edge of the box to edge a wild encounter.

"He's played a huge part in it, all the confidence he gives all the players," said Mainoo on Carrick's role in turning United's season around. "You want to follow him and fight for him and die for him on the pitch."

Third-placed United open up a six-point lead over Liverpool and are guaranteed to finish in the top five.

Slot's side arrived at Old Trafford depleted without the injured forward trio of Mohamed Salah, Hugo Ekitike and Alexander Isak.

Despite an 11th league defeat of the season, Liverpool likely need only three points from their three remaining games to also secure a place in the Champions League.