Jordi Gomez popped up with the late winner to give managerless Wigan Athletic their first away win in six months thanks to a real backs-to-the-wall effort at fellow strugglers Cardiff.
The Bluebirds had picked up markedly under new boss Neil Warnock of late, but they couldn’t break down a Latics side being guided by the steady hands of Graham Barrow following Gary Caldwell’s sacking on Tuesday.
Goalkeeper Adam Bogdan produced three superb saves, two in the first half to deny Anthony Pilkington and a one-handed effort in the second stanza to thwart Aron Gunnarsson.
Defender Sol Bamba also had a header cleared off the line before the home side ran out of ideas, and they were caught on the break with only three minutes remaining.
Craig Davies - on for Will Grigg - supplied David Perkins, whose cross was stabbed home at the far post by Gomez, who had been barracked by the home supporters for his previous Swansea ties.
The home side had a gilt-edged opportunity to level in stoppage-time, only for Bamba to blast miles over the bar from 12 yards.
They went closer still when Joe Bennett fired goalwards with the penultimate kick of the game, only for Latics skipper Stephen Warnock to get in the way to safeguard a precious three points for the visitors.
The early exchanges were all about hanging on as City, having picked up seven points from a possible nine under the stewardship of Warrnock, sought to take advantage of Wigan’s woeful week.
Pilkington’s close-range header brought a great save from Bogdan, who did even better moments later to parry out a stinging left-foot drive from the same player.
From the resulting corner, centre-back Bamba thought his header had crossed the line, only for a mixture of Bogdan and Reece Burke to somehow get it away.
A lovely move saw Pilkington and Craig Noone play in Joe Ralls, whose shot would surely have troubled Bogdan had a great block from Jake Buxton not eliminated the problem.
Buxton and Dan Burn then combined to crowd out Pilkington, with Latics struggling to gain a foothold in the game.
The visitors showed more promising signs in the 15 minutes before half-time, seeing plenty of the ball, with Gomez winning a free-kick 25 yards from goal only to send it straight into the wall.
Credit to Latics, they started the second period with a spring in their step, and almost edged in front within three minutes of the restart.
Grigg, who was getting little change out of the home defence as he ploughed the lone furrow, stole a yard and saw a left-foot shot take a wicked deflection off Bamba before looping agonisingly wide of the far post.
Buxton got his head to the subsequent corner from Michael Jacobs, but his connection wasn’t quite right and the ball flashed past the upright.
At the other end, Peter Whittingham’s free-kick found the head of Pilkington, who also couldn’t hit the target from a decent position.
The home side went even close moments later when Gunnarsson wriggled his way past Perkins and thumped a rasping effort from 20 yards that produced a fantastic reaction save from Bogdan.
Whittingham then sent a snapshot over the top before Latics made their first change just before the hour mark, Nathan Byrne for Yanic Wildschut, with Grigg making way for Davies as the game entered the final quarter.
The home side were increasingly going long as they attempted to engineer a breakthrough, but the visitors were in determined mood and giving little away.
And Latics were rewarded for their enterprise on the counter when they found the only goal with 87 minutes on the clock.
Davies did well to spot the run of Perkins down the left channel, and the midfielder’s cross across goal was met by the trusty left foot of Gomez, who couldn’t miss from two yards.
Still the points weren’t safe, though, and Latics hearts were in mouths when Bamba somehow blazed high over the bar when it seemed easier to score.
But City knew it wasn’t going to be their day when Bennett drilled goalwards in the last seconds of stoppage-time, only to be blocked by the heroic figure of Latics captain Warnock on the goalline.