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.