The emotions were difficult for Chelsea to process when this wild game was over. On the one hand it was a night when they puffed out their chests on one of European football’s grandest stages, scored twice and were denied a place in the Champions League last 16 by a freakish goal. On the other it was an occasion that exposed their defensive frailties and it spoke volumes that Frank Lampard admitted his young side were fortunate to face opponents who should probably spend the rest of week focusing on shooting practice in training.

Valencia created enough chances to have won several games and the greater frustration belonged to the Spanish club in the end. They almost secured the win in injury time, only for Rodrigo to miss an open goal, and the most important point from Chelsea’s perspective is that they remain in control of their destiny. The equation is simple for the Premier League side: if they win their final game in Group H, at home against Lille on 10 December, they will be through regardless of what happens when Valencia visit Ajax.

Chelsea do like to make life difficult for themselves, though. The contradictions running through this side were typified by an erratic display from Kepa Arrizabalaga, who was the hero when he saved a penalty from Daniel Parejo but the villain when he allowed Daniel Wass’s cross to sail over him for Valencia’s equaliser in the 82nd minute. Chelsea’s lead, established by goals from Mateo Kovacic and Christian Pulisic, never truly seemed safe and that aberration from Arrizabalaga means the job is not done yet.

Equally, there were plenty of positives for Chelsea, even though they now lie in third place after Ajax’s win over Lille. Lampard’s side are unbeaten on their travels in Europe this season, having already won at Ajax and Lille, and there was much to admire about their slick football throughout an absorbing contest.

Chelsea settled well, with Pulisic and Willian lively on the flanks, and their attacking intent was typified by Reece James’s eagerness to provide regular overlaps on the right. Quick, early crosses are a feature of the 19-year-old right-back’s game and one of his teasing deliveries should have led to the opening goal in the second minute, only for Willian to head over from close range.

The cross deserved a better finish and it had the feel of a big miss on a night when both sides knew a win would carry them through. Valencia improved after an awkward start and the first sign of their threat arrived in the 19th minute. Rodrigo scampered behind César Azpilicueta on the right and only Maxi Gómez will know how he failed to convert his fellow forward’s cross, kicking fresh air with the goal at his mercy.

The Uruguay forward would also shoot too close to Arrizabalaga before the half was over as an air of vulnerability hung over Chelsea’s back four throughout. Andreas Christensen, starting in central defence for the first time since 28 September, struggled and James found it hard to track Carlos Soler’s intelligent movement. Chelsea were too open for Lampard’s liking and it did not come as a surprise when Valencia went ahead in the 40th minute. Rodrigo was the instigator again, crossing from the right, and Soler crept between James and N’Golo Kanté before flicking the ball past Arrizabalaga.

Chelsea’s response was immediate. They had created opportunities – Kanté blazed over from 12 yards and Jasper Cillessen made a superb save to deny Tammy Abraham – and the equaliser stemmed from an unlikely source. Lampard has urged Kovacic to show greater conviction in the final third and the Croatia midfielder collected his first Chelsea goal when he spun on the edge of the area before firing home a low drive.

Kovacic was excellent, linking impressively with Jorginho and Kanté in midfield, and he almost scored again moments later. The action remained frenetic and VAR controversy reigned when Chelsea, who lost Abraham to a hip injury after the striker collided with Ezequiel Garay, had the ball in the net in the 50th minute.

Carlos Soler scores the opener. Photograph: TF-Images/Getty Images

Kurt Zouma had headed on Kanté’s cross and Pulisic, flagged offside, had stolen in to prod home. The goal was awarded after a three-minute delay, with replays suggesting Pulisic was onside by the slenderest of margins. Valencia fumed, arguing that Zouma had fouled Gabriel Paulista, and Garay was booked for dissent.

Back came Valencia. Rodrigo chipped over after a mix-up between Arrizabalaga and Christensen and there was another momentum swing when Jorginho fouled José Gayà in the area. Arrizabalaga guessed correctly, however, diving to his right to save Parejo’s firm penalty.

There would be another twist in the 82nd minute. Wass, moved from midfield to right-back, overcooked a cross and Arrizabalaga seemed to move his hands out of the way. When he turned round the ball was in his goal.

Both sides had chances to win it. Zouma had a header cleared off the line and Chelsea had another escape when Rodrigo shot wide in the dying moments. Now for Lille.