If Liverpool go on to complete their three-decade-long quest for the title, expect this match to feature in the showreel. Aston Villa, robust and defiant, were three minutes away from inflicting a first league defeat of the season on Liverpool, which would have given Manchester City as much of a boost as Villa.

Instead, Andy Robertson headed an equaliser in the 87th minute before running into the net to retrieve the ball so that Liverpool could seek a winner, which Sadio Mané delivered in the fourth minute of stoppage time.

The final whistle sent Villa players crumpling to the grass in dismay, as Liverpool’s cavorted around Villa Park in hard-earned glee. They had been discombobulated by fine opponents, frustrated by VAR and their own failings, but they had come out all smiles.

For a while Mohamed Salah may have been regretting advising Trézéguet to join Villa last summer, as the less-acclaimed Egyptian scored his first goal for the club to give them a deserved lead in the 21st minute.

Villa protected that tenaciously for more than an hour and occasionally threatened to increase it. But Liverpool kept coming and, eventually, found a way to leave with all three points.

Villa can at least take heart from performing splendidly without their most influential player, a calf injury depriving them of Jack Grealish. The man who replaced him, Anwar El Ghazi, had Liverpool panicking in the first minute, barrelling past Mané and Vigil van Dijk before unleashing a shot that Allison needed two attempts to hold.

That set the tone for a lot of what followed in a first period in which Villa were sharper and stronger than their opponents, especially in midfield. Liverpool omitted Fabinho, who was a booking away from being ruled out of next week’s showdown with Manchester City, and they missed him more than Villa missed Grealish.

In the 10th minute Wesley was presented with a chance to open the scoring following a short corner routine but he failed to connect properly with Matt Targett’s cross.

Wesley, powerful and smart, treated Van Dijk to a far more uncomfortable game than the Dutchman is accustomed to.

Liverpool did not bare their teeth until the 13th minute, when Jordan Henderson looped a cross towards Mané, who headed wide from eight yards. Salah, very subdued and eventually replaced midway through the second half, tested Tom Heaton with a volley from an acute angle after Van Dijk deposited a long pass on his foot. The keeper saved well.

Then came the breakthrough for Villa. Players of each side lined up on the edge of Liverpool’s area to await a free-kick from the left by John McGinn, but the European champions were not as organised as they looked: Henderson was left to deal with two players at the back. He picked the wrong one to go with, leaving Trézéguet free to sidefoot a volley under Allison from five yards.

No team has been more frustrated by VAR than Villa this season so there was an anxious wait for confirmation that the goal would stand. It did.

Another ruling went in their favour a few minutes later when VAR determined that the assistant referee had been right to put his flag up for an apparent equaliser by Roberto Firmino. A Premier League statement explained the player had been offside by an armpit.

A hat-trick of VAR decisions in Villa’s favour was completed in the 37th minute, when it endorsed Jon Moss’s decision to book Mané for simulation. The Senegal forward was jeered by home fans for the rest of the game. He had the last laugh.

Adam Lallana shot wide from six yards in the 75th minute after the visitors’ most incisive move by that stage. Their dismay could have deepened moments later when Trézéguet pounced on a mistake by Trent Alexander-Arnold, but Van Dijk intervened to stop Villa from doubling their lead.

With three minutes left, Robertson ran on to an excellent cross from the right by Mané and headed into the net from close range.

Liverpool were not done. Deep into stoppage time Alexander-Arnold delivered a corner that Mané met at the near post, guiding a low header into the far corner to ignite wild celebrations among the travelling players and fans.