Preston North End twice paid the penalty as they went down to defeat against Cardiff City in Wales.
Anthony Pilkington scored both of Cardiff's goals from the penalty spot to put the home side in command before Callum Robinson scored in the 87th minute to reduce the arrears and set up an exciting finish.
It was a foul by Paul Huntington on Pilkington which led to the first penalty in the 44th minute, with Paul Gallagher judged to have tugged back Tom Lawrence for the second with nine minutes remaining.
Robinson's goal was his second in successive games after coming on as a half-time substitute.
The defeat was the Lilywhites' first in six games and saw them slip back to 10th place.
It was the fourth game in a row that Simon Grayson had stuck with the same starting XI, PNE lining-up in a 3-5-1-1 system with Adam Reach playing off main striker Joe Garner.
There was a switch on the bench, Neil Kilkenny replacing Eoin Doyle who was not allowed to face parent club Cardiff.
An uneventful opening few minutes gave way to half chances at either end, a strong run from Reach seeing him burst into the box but his shot was blocked and went out for a corner.
Aron Gunnarsson volleyed a first-time effort straight at Anders Lindegaard from 20 yards, before North End had a lucky escape when Pilkington's left-footed centre from the right-wing travelled across the box and hit the inside of the far post before bouncing into Lindegaard's gloves.
The lively Pilkington, once a student at Myerscough College near Preston, fired high over the bar after exchanging passes with Lex Immers.
A slide-rule pass from Daniel Johnson played Reach in down the right hand side of the box but he a scuffed a shot from a tight angle across goal and wide of the far post.
Lindegaard produced an outstanding double save to keep out the Bluebirds with 27 minutes on the clock.
He dived to push a Pilkington header against the near post then spread himself to block Immers' follow-up.
With much of the attacking play being done by the hosts, Pilkington swept a first-time shot high over the bar and Immers nodded wide of the back post after Lee Peltier's cross had picked him out.
Cardiff went ahead in the 44th minute from the penalty spot, Huntington bringing down Pilkington after the striker had cut inside a bit too easily from the inside-left channel.
It was Pilkington who dusted himself down to take the spot kick, sending Lindegaard the wrong way with a confident effort.
Huntington was replaced at the interval by Robinson as North End switched to a 4-3-3, as they had done against Charlton at the same stage of the game last Tuesday night.
The visitors started the second half brightly, having plenty of possession but lacking the final ball as they got in and around the Cardiff penalty box.
Robinson saw a shot charged down, while a Gallagher corner found Alan Browne but he got his angles wrong and the ball hit him on the back of the head and went wide.
After an hour, Scott Malone's cross from the left was met by Pilkington on the half-volley, Lindegaard diving to his right to hold at full-stretch.
Grayson made his second substitution in the 63rd minute, Jordan Hugill replacing Johnson, another system switch seeing North End go to a 4-4-2 with Robinson and Reach either side of Hugill and Garner.
North End had the ball in the net soon after, Robinson's cross from out on the left-wing volleyed in at the far post by Reach but the flag went up for offside, possibly against Garner despite him not having touched the ball.
At the other end, good work on the left of the box from Tom Lawrence created an opening for Pilkington, the striker's shot catching a deflection off Tom Clarke which took it over the bar at the near post.
Cardiff's second goal - and penalty - came nine minutes from time when Gallagher tugged at Lawrence's shirt.
It was the assistant on the far side who signalled for it, referee Brendan Malone pointing to the spot on his advice.
Again it was Pilkington taking it, slamming it down the middle as Lindegaard dived to his left.
North End gave themselves hope of salvaging something from the game when they halved the deficit in the 87th minute.
Substitute Ben Pearson played Greg Cunningham into the space down the left, the Irishman getting down the side of the home defence and pulling the ball back into the path of Robinson on the edge of the box.
Robinson's finish was a composed one, the youngster steering a low shot into the far bottom corner.
Unfortunately, they could not find a second way through as four minutes of stoppage-time was signalled.
The nearest they got was a Robinson's free-kick from 25 yards which cleared the bar by some distance.
Cardiff: Marshall, Peltier, Connolly, Manga, Malone, Lawrence (Ameobi 90), O'Keefe, Gunnarsson, Ralls, Inners (Zohore 90), Pilkington (Dikgacoi 82). Subs (not used): Oshilaja, Macheda, Saadi.
PNE: Lindegaard, Clarke, Huntington (Robinson 46), Wright, Woods, Browne, Gallagher (Pearson 84), Johnson (Hugill 63), Cunningham, Reach, Garner. Subs (not used): Vermijl, Welsh, Kilkenny, Hudson
Referee: Brendan Malone (Wiltshire)