BARCELONA, Spain -- Lionel Messi is a minor doubt for Barcelona's game against Real Madrid on Wednesday after ending Saturday's 2-2 draw with Valencia with a thigh problem.

Messi, who scored twice as Barca came from two goals down to earn a point against Valencia at Camp Nou, received treatment on the sidelines for five minutes during the second half.

The Argentine forward was eventually able to finish the game, but he will now undergo tests to determine the severity of the injury.

Barca coach Ernesto Valverde is hopeful that it's nothing too serious and is optimistic that Messi will be available to face Madrid in the Copa del Rey semifinal first leg.

"We have to wait until [Sunday] to see how the pain is," Valverde said in his postgame news conference. "I can't help you any more than that. We hope that he will recover [in time] for Madrid. Either on Sunday or on Monday we'll determine exactly what the problem is.

"I don't know what it is. We will see what the medical team tell us but we don't imagine it is anything too bad."

Barca beat Madrid 5-1 in the league earlier this season with Messi missing through injury, but he once again demonstrated his importance against Valencia.

A goal from Kevin Gameiro and a Dani Parejo penalty had given Valencia an unexpected 2-0 lead at Camp Nou but Messi's 20th and 21st league goals of the season earned Barca a draw.

He scored from the penalty spot just before half-time and added his second after the break with a brilliant finish from 20 yards as Barca's eight-game winning streak in La Liga came to an end.

"Valencia started really well but after that we were in control of the game," Valverde said. "We weren't switched on and they caught us on the counter and then doubled their lead with the penalty.

"But we have taken charge of the game from there. We were dominating the ball and the feeling was that we could score goals. It was a good reaction in the end but when you don't win you always feel that something has slipped away."

Barca could see their lead at the top cut to three points if Atletico Madrid beat Real Betis on Sunday, but in the meantime they will turn their attention to Wednesday's Clasico in the cup.

As well as Messi, there are also doubts about Ousmane Dembele's availability for the game. The Frenchman has missed Barca's last four matches and Valverde said he didn't know whether he would make his comeback from injury against Madrid on Wednesday or at Athletic Bilbao on Sunday.