David Beckham's storied career took a dramatic turn when he celebrated his return to the Real Madrid lineup with a goal on a free kick to help the Merengues beat Real Sociedad, 2-1, in La Liga on Saturday night.

The win probably saved the job of Real coach Fabio Capello, who had banished Beckham from the first team after the 31-year-old Englishman announced on Jan. 11 that he would be joining MLS's Los Angeles Galaxy next summer. The turn of events was not lost on the Madrid press.

''Capello, you owe him one,'' ran the headline of sports daily Marca, adding that Beckham had ''saved the coach with a free kick 34 days after he was condemned.''

Beckham's goal came in his first appearance for Madrid since Jan. 7 and his first full match since Dec. 20. He scored the tying goal on a 25-yard free kick that skidded under goalkeeper Claudio Bravo and inside the far post.

Beckham's former Manchester United teammate, Ruud van Nistelrooy, scored the winning goal in the 48th minute, marking the first time in 11 games Real Madrid had scored more than one goal.

The win, coming after back-to-back losses to Levante and Villarreal, moved Real into third place, ahead of Valencia, and kept it five points behind Barca, a 2-0 winner over Racing Santander on a pair of Ronaldinho goals.

''You have to be happy when players score important goals, and David's goal was very important,'' said Capello. ''He played a great game and deserves the credit.''

Van Nistelrooy was also full of praise for Beckham.

''Beckham has been fantastic, his attitude has been brilliant,'' said the Dutchman. ''When you go for a month without playing it isn't easy to be at your best but he always trains hard and has a very positive attitude. That's why you can always bet on him. It was a great day for him.''