Veteran forward Filippo Inzaghi stole the show from David Beckham with a hat trick as AC Milan returned to winning ways in a 3-0 success over Atalanta at the San Siro on Sunday. The script seemed to have been written for Beckham to score the winner on the same day that it was announced he would stay at Milan until the end of the season, but instead it was his 35-year-old teammate whose treble proved decisive. Perhaps more important for Milan, who've been in disarray on the pitch recently, going out of the UEFA Cup 10 days ago and losing at Sampdoria in the league last weekend, is that the victory gave it a five-point gap over fourth-placed Fiorentina, which lost 2-0 at home to Palermo. Only the top three in Serie A will go straight into next season's Champions League group stages with the fourth place finisher having to negotiate two qualifying rounds. With his contract uncertainty behind him, Beckham seemed to have a new lease of life and he was even given a free role behind forwards Inzaghi and Pato by Ancelotti. There was no change to the top three in Serie A as Inter Milan and Juventus both won on Saturday, 2-0 at Genoa and 1-0 at Torino respectively. Serie A top scorer Marco Di Vaio also scored a hat trick as Bologna thrashed Sampdoria 3-0. In Sunday's other games, it was: Catania 0, Siena 3; Chievo Verona 1, Cagliari 1; Lecce 0, Reggina; and Napoli 0, Lazio 2. Beckham paying to stay Beckham is spending his own money to remain on loan with AC Milan before he returns to the Los Angeles Galaxy in July. The English midfielder will stay through the end of the Italian team's season, which concludes May 31. He'll be available for England's two World Cup qualifiers in June before taking a few weeks off and rejoining the Galaxy on July 1. But it's going to cost Beckham to stay overseas. He and AC Milan are jointly paying the Galaxy in a “multimillion dollar deal” to extend his loan, the Galaxy said in a statement issued late Saturday night. “A lot of players show their affection just with words. David Beckham is one of the very few who has shown it with deeds,” AC Milan chairman Adriano Galliani said Sunday on Italian state television. The Galaxy had sought at least $10 million for the outright purchase of Beckham, but AC Milan officials had offered $3 million.