Liverpool staged one of the most amazing comebacks of their glorious European history to snatch victory from the jaws of defeat in Spain.
But their dramatic night of triumph was ruined in the last minute when both Steve McManaman and Paul Ince were sent off along with Valencia's Amedeo Carboni. The Italian had hit McManaman, who retaliated. Ince rushed into the melee and was also sent off.
In a dramatic final minutes - almost seven over normal time - Valencia pulled one back when a Claudio Lopez free-kick hit a post, bounced back to hit James, and then span over the line.
But it wasn't enough to grab Liverpool's amazing prize from their hands. They had been outplayed and overrun for long spells but hit back with two goals in the dying minutes through McManaman and Patrik Berger to take the lead.
Somehow they found themselves ahead, and despite that unbelievably tense finish, it is Liverpool who are heading into the third round with the intense pressure lifted from the heads of joint managers Roy Evans and Gerard Houllier.
What they did find was their heart and courage under fire, and that could be treasured extra from an incredible night.
Jamie Redknapp made his expected comeback after missing four games with a thigh problem, while Valencia had former Arsenal star Stefan Schwarz back in their side.
Liverpool were under intense pressure from the start in the intimidating atmosphere of the packed, high-sided Mestalla stadium.
Romanian ace Adrian Ilie was a sensation, and Argentinian Claudio Lopez not far behind, as they tormented Liverpool's back line.
Lopez could have had a hatful. First he latched onto a Steve Staunton slip, raced into the box, and sent a cross-shot wide of the far post.
But in the midst of almost constant pressure Liverpool nearly scored. McManaman strode onto a Patrik Berger lay-off after eight minutes and drove a 20-yarder against the post. The ball bounced out, hit 'keeper Santiago Canizares in the back and broke for Berger to blast the rebound wide.
But the pressure was unrelenting on the troubled Liverpool back line. Jamie Carragher lost the ball after 13 minutes, and Ilie put Lopez through. David James was alone in the box as the Argentinian World Cup star ran on, but the Liverpool 'keeper kept his nerve, stayed on his feet, and the striker pushed his shot wide of the upright.
A minute later, another Staunton error let in Lopez again, but James made a superb save to his left.
Liverpool were gave away a string of dangerous free-kicks, as Valencia piled on the pressure, and at times, the Merseysiders could barely get out of their half as they conceded possession and looked on the point of collapse.
Amedeo Carboni went on one stunning, jinking run to win a corner, and when the ball was only half-cleared to him, the Italian forced James into another save.
A minute later, James was put under intense pressure by Lopez as he tried to control a back-pass and almost gave the ball to the lethal striker.
Liverpool were in desperate straights, and Redknapp was finally booked for his fifth foul, bringing down Carbone after 35 minutes. Shortly after, Vegard Heggem was cautioned for tripping Ilie.
Heggem was in action at the other end, producing a run and cross that Fowler rose to head wide.
The goal finally came in first-half injury time when Ilie lashed a shot against the post, and Lopez drove in the rebound. All that was left was for Ince to get himself booked in the dying seconds of a tortured half.
Three minutes after the break, Michael Owen ran onto a Robbie Fowler nod, surged into the box, but was forced wide and saw his shot smothered by Canizares.
But the Valencia onslaught continued when Ilie danced and dazzled Heggem out on the left before spinning and driving a 20-yarder a foot wide of the post.
It seemed only a matter of time before Valencia scored again, but Liverpool were trying to slow the game down and give themselves time to think, rather than keep floundering and being left trailing on the wake of quick, nimble players.
Owen's pace seemed to be about their only real option, and the youngster who was left out of the first leg, ran himself ragged up-front trying to catch defenders lacking concentration.
Ilie was Liverpool's tormentor in chief, his control, refusal to be knocked off the ball, and breathtaking ability were constant dangers.
Fowler was the next Liverpool man to be booked. After being penalised, he stupidly turned to sarcastically clap the French referee.
But Valencia opted to sit back and defend their lead, and that was a criminal error. Carragher, Owen and Fowler all had chances as Liverpool grew in confidence.
Then with 10 minutes left, Owen won possession on the right, crossed superbly to the far post, and McManaman steamed in to head Liverpool level.
They were now through on the away-goals rule if the score stayed level, but with four minutes left, Berger put this most improbable result beyond doubt with a stunning left-foot drive to give Liverpool the lead.
The only voices now in a near-silent stadium were those of Liverpool supporters high in the stands singing their hearts out.
The flurry of red cards, plus Valencia's late, late strike, made this a remarkable night that few who saw it will ever forget.
Valencia CF: Canizares, Djukic, Mendieta, Lopez, Schwartz, Illie (Lucarelli 75), Bjorklund, Carboni, Popescu, Angulo, Soria.
Subs Not Used: Bartual, Juanfran, Camarasa, Farinos, Milla, Tellez.
Sent Off: Carboni (90).
Goals: Lopez 45, James 90 og.
Liverpool: James, Staunton, McManaman, Fowler (McAteer 85), Owen, Redknapp, Heggem (Dundee 79), Berger (Harkness 89), Ince, Bjornebye, Carragher.
Subs Not Used: Friedel, Kvarme, Leonhardsen, Thompson.
Sent Off: McManaman (90), Ince (90).
Booked: Heggem, Redknapp, Ince, Fowler.
Goals: McManaman 81, Berger 86. Agg (2-2)
Ref: G Veissiere (France).
Copyright - Press Association