Former Real Betis player Dani Ceballos stunned his old club with a late free-kick as Real Madrid snatched a dramatic 2-1 victory on Sunday.

The substitute, who moved to the European champions in 2017, curled a low shot around the wall two minutes from time to lift Madrid back into the top four in LaLiga.

Sergio Canales, an ex-Madrid player, looked to have secured a point for Betis after cancelling out Luka Modric's superb early strike.

The result was harsh on Betis, who controlled a lot of possession and were the more incisive in the second period.

But they failed to make the most of their dominance early on and Madrid, despite lacking Gareth Bale, Marco Asensio and Lucas Vazquez in attack, were a serious threat on the break. Vinicius Junior, the 18-year-old Brazilian who overcame flu to feature, was a particular handful.

Madrid claimed a 13th-minute lead after Karim Benzema broke on the right and cut inside before having a shot blocked. Dani Carvajal's follow-up attempt was also blocked but Modric made no mistake as he smashed home from outside the area.

It was Modric's first league goal of the season and he had another chance from a similar distance after Benzema again led a counter-attack but this time the Ballon d'Or winner fired over.

Luka Modric netted early on for Real Madrid

Betis finally threatened midway through the first half but Giovani Lo Celso's shot drifted wide. Madrid should have doubled their lead 11 minutes before the interval when the impressive Vinicius launched lightning raid down the left.

He swept the ball inside for Federico Valverde, who took it in his stride and raced through on goal. He looked certain to pull the trigger but miscontrolled as he reached the area and Antonio Barragan got back with a fine sliding tackle.

Vinicius tested Pau Lopez in the Betis goal with another attempt before the hosts went close themselves when Canales curled a free-kick wide.

Benzema ended the first half in considerable pain after landing awkwardly on his hand and suffering a nasty-looking finger injury. The Frenchman was replaced at the start of the second period by Cristo.

William Carvalho celebrates after the Real Betis equaliser

Betis showed more urgency as the game resumed and Joaquin fired a shot at Keylor Navas before Andres Guardado struck a sweet volley narrowly wide on the hour.

Madrid failed to heed the warnings and were punished for their drop in intensity after 67 minutes. Lo Celso played Canales in on goal with a fine pass and the forward kept his composure to slide in and slip the ball through Navas' legs. Madrid were briefly relieved to see a flag raised for offside but that was overruled following a VAR review.

Also See:

Madrid struggled to muster a response and appeared to be running out of ideas as the game drifted towards a conclusion. Brahim Diaz, the forward signed last week from Manchester City, was introduced eight minutes from time but it seemed the visitors would have to settle for a point.

That changed in the dying moments as the visitors won a free-kick outside the area and Ceballos stepped up to fire home. He did not celebrate but it was a decisive blow.