Gelsenkirchen: Schalke rallied to beat Valencia 3-1 on Wednesday and reach the quarterfinals of the Champions League, a victory that may not be enough to save coach Felix Magath's job.
Ricardo Costa put Valencia ahead in the 17th. But Jefferson Farfan equalized with a free kick in the 40th and Mario Gavranovic notched the second in the 52nd. Gavranovic hit the frame of Valencia's goal twice late in the match before Farfan secured the victory deep into stoppage time.
The two teams drew 1-1 in the first leg in Spain.
Earlier in the day, German media reported that Schalke's board had decided to end Magath's contract at the end of the season, halfway into his four-year contract.
Although Schalke has had an inconsistent season in the Bundesliga and is only 10th, it is also in the final of the German Cup and now has reached the quarterfinals for the second time since 2008.
Shortly before the match, Magath said he was not aware of the decision of the club's board reported by several German media.
"I haven't heard yet, it's news to me," he told German television.
After the match, Magath called the reports "noise from the sidelines."
"It doesn't interest us and it shouldn't interest us, the truth was plain to see on the field," Magath said. "I plan to continue my work until 2013."
Ricardo Costa headed Valencia ahead, connecting with a cross from Mehmet Topal, who easily shook off Joel Matip.
Schalke tied the match five minutes before halftime, when Farfan curled in a free kick over the Spanish wall from 18 meters (yards) out, after Gavranovic had been brought down.
"We tried to play attacking football from the start but we were tense," Magath said. "After falling behind, we had nothing to lose."
Gavranovic scored the go-ahead goal for Schalke after a cross from Peer Kluge was poorly cleared by goalkeeper Vicente Guaita. Farfan picked up the ball and shot at the goal, Guaita dropped it and Gavranovic pounced to hit the post. The ball bounced off the inside of the post and across the line.
Aritz Aduriz had two good opportunities after that as Valencia stepped up the pace.
The Valencia forward first hit the outside netting, then had his chipped attempt tipped over by Schalke's goalkeeper Manuel Neuer in an outstanding save.
Substitute Tino Costa could have scored with his first touch of the ball but sent his effort wide.
Joaquin's dangerous-looking shot from outside the penalty area hit referee Jonas Eriksson of Sweden.
On the other side, Gavranovic nearly notched his second, but his shot brushed the fingers of Guaita and bounced off the post.
Gavranovic had another opportunity late, finishing a counterattack with a lob that struck the crossbar.
While Valencia pressed ahead desperately looking for a goal that would tie the match and take the Spanish team into the last eight, Farfan struck again four minutes into injury time, chipping the ball past Guaita into the far corner to finish off another counterattack.