Lionel Messi helped Barcelona rebound from its loss at AC Milan by extending his league-record scoring run to 15 straight games in a 2-1 win over Sevilla on Saturday, three days before the Spanish leaders’ key Copa del Rey clash with Real Madrid.

Barcelona striker David Villa cancelled out Alberto Botia’s opener with a header in the 52nd before Messi grabbed the winner in the 60th with his league-best 38th goal through 25 rounds.

Madrid, meanwhile, needed Kaka to score his first goal in the Spanish league this season and cue Gonzalo Higuain’s late winner to come back 2-1 at last-place Deportivo La Coruna.

The archrivals will meet at Camp Nou Stadium on Tuesday with their Copa del Rey semifinal poised at 1—1.

“Tuesday we face a final for us, but we have the (away-goal) advantage,” said Barcelona defender Javier Mascherano. “Madrid is a great rival but we have to finish the job.”

Barcelona’s 11th win in 12 league home games kept it on course to recover the league title from Madrid, which is 16 points adrift.

Atletico Madrid is 15 points behind Barcelona before it plays Espanyol on Sunday.

The first half at Camp Nou resembled Barcelona’s disappointing 2-0 loss at Milan in the Champions League on Wednesday when the Catalan side couldn’t turn its control into goals and its defense proved brittle.

Sevilla resisted well early on and its plan paid dividends three minutes before halftime when it struck through its first incursion into Barcelona’s area from a free kick by Ivan Rakitic. Botia, a former Barcelona youth player, rose over his marker to turn Jorge “Coke” Andujar’s cross bouncing off the turf and beyond the reach of goalkeeper Victor Valdes.

Frustrated in its attempts to penetrate through the middle, Barcelona turned to the more traditional cross-and-volley route as Dani Alves picked out Villa strolling down the middle of the box to thump his lobbed pass home for the equalizer.

Messi, who missed with a pair of free kicks, put Barcelona ahead for good when he slotted in a pass from Cristian Tello after he had started the move by playing Tello wide.

Barcelona still escaped with the victory only because Sevilla wasted its looks on goal.

Sevilla also has a critical second leg in the cup on Wednesday when it must overturn a 2-1 loss to Atletico Madrid to reach the final.

After Tuesday’s decisive match, Madrid will host Barcelona in the Spanish league on Saturday.

Kaka was in Madrid’s starting lineup only because coach Jose Mourinho rested several players, including top scorer Cristiano Ronaldo, for the looming trip to Barcelona.

The move almost backfired when Deportivo striker Ivan “Riki” Sanchez took a well—struck goal in the 32nd.

Desperate for a win in the home debut of Fernando Vazquez, its third coach in this strife—filled season, Deportivo outplayed Madrid in all facets during the first 45 minutes.

But after leaving Madrid without a shot between the posts until Jose Callejon’s try in the final seconds of the first half, even Deportivo’s best effort wasn’t enough compared to Madrid’s talent and two moments of inspiration from Kaka.

Banished to the bench for the better part of the last two seasons, Kaka said the playing time he was getting with Madrid out of contention for the league title was helping him recover his form.

“I’m feeling much better,” said Kaka. “My coach needs me and I have to be playing well for the crucial part of the season.”

The former world player of the year came through late when Deportivo’s legs had grown heavy to give Madrid just its second win at Riazor Stadium in 20 years.

Ronaldo went on for Madrid in the 57th, but it fell to the little-used Kaka to level in the 73rd with an exquisite long-range strike reminiscent of his glory days at Milan.

Kaka then played Ronaldo clear in the 88th for the Portugal forward to cross to the unmarked Higuain who just had to push the ball home to prevent Madrid from slipping up again on the road.

“We were anxious in the first half and made too many mistakes,” said Kaka. “Things improved in the second half and we were able to get three important points to get ready for what is in store for us.”

Madrid forward Angel Di Maria was sent off in stoppage time with back-to-back yellow cards.

Elsewhere, Jonas scored a double to secure Valencia a 2-2 draw at 10-man Real Zaragoza and lift the team into fifth place, while Getafe rallied for a 3-1 win at relegation-threatened Mallorca.

More In: Football | Sport