CARSON, Calif. – David Beckham stood on the podium with his three sons, an oversized Union Jack knotted around his Los Angeles Galaxy jersey. With a practiced lift and broad smile, he raised the sparkling silver cup over his head to a raucous ovation amid a confetti blizzard.

That’s a Hollywood ending.

Beckham wrapped up his MLS career as a two-time champion Saturday, with Landon Donovan’s tiebreaking goal on a penalty kick in the 65th minute propelling the Galaxy to a 3-1 victory against the Houston Dynamo in the MLS Cup.

Omar Gonzalez tied it in the 61st minute with a long header for the Galaxy, who defended their title in a rematch of last season’s final. For the second straight year, Beckham raised a trophy that stands as evidence of the 37-year-old English midfielder’s indelible impact on American soccer during his six seasons in Los Angeles.

“It’s been a successful six years here, and now that we’ve won the second one, it’s even more satisfying,” Beckham said. “I just hope people have enjoyed me playing here. It’s what I hope for when I step on the field.”

With a stirring second-half surge capped by Robbie Keane’s goal on another penalty kick in injury time, Los Angeles won its fourth MLS Cup, tying D.C. United for the league record.

The Galaxy also gave an appropriate farewell to Beckham, who will play elsewhere in the new year before eventually returning to MLS as a team owner. With rumors linking him everywhere from Sydney to Paris, he hasn’t disclosed his immediate plans.

Los Angeles will miss Beckham, but the glamorous global icon is going out at an apex for MLS’ highest-profile franchise.

“I just hope I’ve brought a bit of interest to the game (in America),” Beckham said. “If that’s the single thing I’ve done, then great. But I think the foundations are there now in this league. It’s a 17-year-old league and the foundations are great. It will continue to grow.”

After Calen Carr put Houston ahead in the 44th minute, Beckham and his high-scoring teammates systematically broke down the defense of the Dynamo, who lost the MLS Cup 1-0 to Los Angeles on the same field last year.

While Gonzalez tied it on a cagey play, Keane played another stellar attacking game for Los Angeles before earning his own penalty kick when Houston’s Tally Hall knocked him down in the box.

Donovan redeemed himself for missing an open net in the 13th minute by burying his penalty kick after a handball in the box by Houston’s Ricardo Clark. Donovan, who is also contemplating a departure from soccer, won his record-tying fifth MLS title while scoring his fifth career MLS Cup goal and the record 22nd goal of his postseason career.

“It’s a little surreal,” Donovan said. “In any sport, to repeat is really hard to do. For me personally, this felt more satisfying (than last year). We could enjoy it a little bit more.”

After Keane’s goal clinched it, Beckham left the game to a raucous standing ovation from the packed stadium amid chants of “Thank you, David!”