Samuel netted midway through six minutes of stoppage time to give Malaga the lead for the third time in the match and this time battling Betis could not find a response as Bernd Schuster's men picked up their first win in six matches.
To add insult to injury for Betis, the extra time was added because of a serious-looking head blow suffered by their centre-back Damien Perquis at the start of the second half that required lengthy treatment before he was taken away in an ambulance.
The loss of Perquis and Samuel's late clincher soured what had been a promising performance from Betis, who had twice fought back from goals down to level at 2-2 and had chances to get more.
Roque Santa Cruz, playing against his former club, and Eliseu Pereira twice put Malaga ahead in either half but Betis levelled through Joan Verdu and Jordi Figueras, only for the visitors to end up empty-handed right at the end.
The hosts took the lead in the 12th minute when Santa Cruz nodded home at the second attempt after he had headed Eliseu's cross up into the air.
That was not enough to give the hosts a half-time lead though as Betis drew level in the 33rd minute through Verdu's 25-yard free-kick, the former Espanyol playmaker superbly curling home his side's only genuine effort on goal before the break.
Betis lost Perquis just after half-time following a clash of heads with Malaga forward Fabrice Olinga.
The Poland international appeared to have been knocked unconscious and, after receiving lengthy treatment and being put into a neck brace, he was stretchered into the back of an ambulance that had come onto the pitch and was driven away.
Betis did not appear to let that incident affect them too much though as nine minutes later they almost took the lead when Alvaro Vadillo beat his marker and, with Malaga defender Sergio Sanchez standing off, he had free shot at goal which Willy Caballero did well to turn over.
Vadillo should have made more of that chance, and the missed opportunity became even more painful for the visitors as Malaga raced down the other end and re-took the lead.
Willy claimed the corner he had conceded with his save before launching a rapid counter-attack which led to Fabrice feeding Francisco Portillo on the edge of the box. Portillo in turn played a fantastic reverse ball into Eliseu who took a touch to get it back on his left foot before curling home into the bottom corner.
It was clinical goal by Malaga but their joy turned to frustration just two minutes later as Betis levelled again following another set-piece.
Juan Carlos fizzed in a free-kick from the left and Figueras rose near the penalty spot to send a glancing header into the far top corner.
Both sides pushed for a winner, Malaga replacement Juanmi being denied by a good save from Stephan Andersen and Markus Steinhofer wasting a great opportunity at the other end, but it was the home side who made the decisive breakthrough.
Portillo's deflected shot came back off the crossbar and Samuel, who had only been on the pitch seven minutes, slammed home the rebound.
Betis later confirmed that Perquis had been taken to a local hospital where it was discovered he had sustained a double break in his jaw.
A statement on www.realbetisbalompie.es read: "Damien Perquis suffered a head injury which caused a concussion and a loss of consciousness, which is why he was urgently taken to Malaga's Hospital Carlos Haya.
"Once stabilised, a double fracture of the jaw was detected. Currently, Perquis is conscious and will be moved to Sevilla's Hospital Fremap, where tomorrow he will be examined by a maxillofacial surgeon."