Atletico close in on title as late show downs Elche
Atletico Madrid's forward Diego Costa celebrates after scoring during a Spanish league football match against Elche at the Vicente Calderon stadium in Madrid on April 18, 2014 - by Dani Pozo
After a poor opening period from the hosts, they wasted a great chance to go in front 10 minutes after the break as David Villa's penalty was saved by Manu Herrera.
The league leaders did eventually make the breakthrough 19 minutes from time when Miranda headed home Jose Sosa's cross and Diego Costa converted a second Atletico penalty of the night late on after Christian Sapunaru was sent-off for Elche.
Victory moves Atletico six points clear of Real Madrid at the top of the table and within three wins of sealing the title.
In contrast to their recent displays at home, Atletico were very slow out of the blocks and were thankful to Thibaut Courtois for being level at half-time.
The Belgian international flew to his left to turn Javi Marquez's low drive behind midway through the half and, from the resulting corner, Courtois made an even more impressive stop as he parried Sapunaru's header from point-blank range.
Filipe Luis then had a good chance to put the hosts ahead as he scuffed his shot after a fine run and cross from Arian Lopez, but Elche were soon back on the attack and Carles Gil should have done better when he blasted over under no pressure inside the area.
Atletico's best opening of the first-half came three minutes before the break when Juanfran's cross was flicked on at the near post by Diego Costa and side-footed inches wide by Villa.
Diego Simeone introduced Raul Garcia on for Adrian at half-time and he made an instant impact as he was dragged down inside the area by Sapunaru.
David Villa assumed the penalty taking duties after Costa had missed against Getafe last week, however the Spanish international was also denied as Manu Herrera sprung to his left to turn the ball behind.
Villa then had a goal rightly ruled out for offside and Garcia headed just over as the pressure began to build from Atletico.
And the goal finally arrived when Sosa's corner was met by a brilliant header from Miranda to sent the ball back across goal into the corner of the net.
Costa had a great chance to kill the game off as he raced onto a fine through ball from Diego Ribas two minutes from time, but Herrera made a fine low save with his legs.
Two minutes later, though, Costa was bearing down on goal again when Sapunaru bundled him over and was shown a straight red card for denying a clear goalscoring opportunity.
Costa dusted himself down and rolled home the penalty to register his 35th goal of the season and sent Atletico into their Champions League semi-final, first leg with Chelsea on Tuesday in high spirits.