Michael Farfan stunned the crowd at The Home Depot Center on Wednesday, netting the game-winner in second-half stoppage time to help the Philadelphia Union claim a 2-1 victory over the Los Angeles Galaxy.

The visitors took the lead just before halftime thanks to a creative finish from Jack McInerney, but Chad Barrett pulled one back for the Galaxy 17 minutes from time.

Los Angeles thought it had done enough to claim a point at home, but Farfan ensured a dramatic finish with his first goal of the season, giving the Union their first defeat of the Galaxy in club history.

With two successive losses, Los Angeles (6-10-2) stays put in sixth place in the Western Conference with just 20 points through 18 games.

Philadelphia (4-9-2) has won two of its last three league games, picking up its first road win under interim head coach John Hackworth.

Los Angeles dominated the opening half, creating a flurry of scoring chances only to be thwarted by several goal-line stops from the Union defense.

The Union stole the lead against the run of play as Farfan slipped a pass in front of net just before the break. McInerney put the ball past Josh Saunders with a nifty back-heel on the turn for his third goal of the season.

David Junior Lopes came close to leveling the score in the 60th minute when a cross into the box was not dealt with by the Union defense. The Galaxy defender hammered the loose ball toward goal but the shot rattled the crossbar before getting cleared to safety.

The home side ultimately got on even terms through a well-worked goal in the 73rd minute.

A failed clearance fell to Landon Donovan at the top of the box and he picked out Todd Dunivant's overlapping run down the left flank. Dunivant delivered a low cross into the box that eluded Robbie Keane, but Barrett was making a secondary run to calmly slot the ball into the back of the net.

Los Angeles pushed for another goal, but Philadelphia stole all three points thanks to Farfan's stoppage-time winner.

Lionard Pajoy held up the ball before finding Farfan with a back-heel in behind the Galaxy defense. The Union youngster got into the box and curled a shot past Saunders at the far post to help the visitors claim an improbable win.

Both sides return to action Sunday as the Union host Toronto FC at PPL Park while the Galaxy head to Toyota Park to face the Chicago Fire.