(Adds Semedo injury news)
BARCELONA, Nov 9 (Reuters) - Lionel Messi scored two exquisite free kicks as he netted his first hat-trick of the season in a 4-1 win over Celta Vigo at the Camp Nou on Saturday which took Barcelona back to the top of La Liga after a difficult week.
Barca's captain coolly converted a penalty to put the champions ahead in the 23rd minute but gave away a foul in a dangerous area which led to Lucas Olaza levelling for Celta with an outstanding strike from a free kick in the 42nd.
But Messi restored Barca's lead right before halftime with a stunning free kick of his own, curling the ball into the top corner.
He conjured up an almost identical strike at the start of the second half to complete his treble and match Cristiano Ronaldo's record of 34 hat-tricks in Spain's top flight.
Sergio Busquets struck a fourth goal in the 85th to round off a first win for Barca in three games, after falling to a shock 3-1 defeat at Levante last week in La Liga and drawing 0-0 at home to Slavia Prague in the Champions League.
"We have a very big advantage, we have the best player in the world on our side who is also the best at taking free kicks," said Busquets in praise of Messi.
"Little by little he has been improving at free kicks, he used to find them hard. Having him around gives us a real boost."
Barca lead the standings on 25 points after 12 games, level with second-placed Real Madrid who eased to a 4-0 win at Eibar.
Despite going into the weekend within striking distance of top spot, the Catalans have had an uneasy campaign which hit a new low this week as players were booed off the pitch following the goalless draw at home against Slavia.
There was a subdued atmosphere at the Camp Nou on Saturday and close to 30,000 seats were left empty.
Celta were playing their first game under former Barca player Oscar Garcia, after Fran Escriba was sacked following four consecutive defeats.
The visitors did well to contain Barca in the opening stages until Messi took advantage from the penalty spot but howls of frustration could be heard across the ground after Olaza's superb equaliser.
As has so often been the case, it was up to Messi to lift the mood again.
"With Messi anything is possible," said Barca coach Valverde.
"He dominates the art of free kick taking, and opponents know they cannot afford to give away fouls near our area. When they do, we try to take advantage."
The coach also underlined how important it was that his side got back to winning ways.
"When you lose a game it's always important to win the next one, especially at a club like ours. The other day we had a painful defeat and we had to win today," he said.
There was bad news for Barca after the fulltime whistle, however, as the club released a statement saying first-choice right back Nelson Semedo was ruled out for around five weeks with a calf injury sustained during the game.
(Reporting by Richard Martin, editing by Ed Osmond and Hugh Lawson)