Middlesbrough ended a run of three consecutive Sky Bet Championship defeats with a 2-1 victory at Swansea achieved in strange fashion.
Substitute Samuel Silvera struck the 77th-minute winner, whipping home a close-range free-kick after Swansea goalkeeper Carl Rushworth had been penalised for picking up Harry Darling’s back pass.
Middlesbrough led at the interval through Sam Greenwood’s composed finish, but Jamal Lowe equalised to give Swansea hope of only a third home league win this term.
Alan Sheehan took caretaker charge for the third time, with Swansea still hoping to appoint Tottenham coach Chris Davies as Michael Duff’s permanent successor.
Swansea had picked up four points from Sheehan’s two games, while Middlesbrough boss Michael Carrick was seeking to arrest a decline that had brought four defeats from their last five games.
The vast majority of first-half chances fell Swansea’s way, with the hosts dominant in the early stages.
Unfortunately for Swansea, many of them fell to defenders, with Middlesbrough goalkeeper Seny Dieng grateful for their wastefulness.
Darling, fresh from his late midweek equaliser at Stoke, strode forward to ripple the side-netting and the unmarked Josh Key headed over from eight yards.
Liam Walsh soon swung over another delicious cross which Bashir Humphreys beat Dieng to, only to plant his header wide with the goal gaping.
There was brief discomfort for Swansea – and Rushworth in particular – when the goalkeeper fell heavily under Emmanuel Latte Lath’s challenge and needed treatment before being able to continue.
Further evidence of Swansea’s profligacy in front of goal came midway the first period.
Josh Tymon sent Lowe scampering into the channel behind Dael Fry and the Jamaica forward took his time to pick the right pass, squaring to Walsh whose effort went inches wide.
Middlesbrough bared their teeth for the first time as Matt Crooks set up Greenwood and his shot forced Rushworth into action at his near post.
The deadlock was broken two minutes before the break after a spell of patient passing from the visitors.
Crooks moved inside from the left to spot Greenwood’s run and a fine left-footed finish gave the on-loan England Under-21 international his fifth Middlesbrough goal.
Swansea were not deflated by falling behind and Jamie Paterson fired wide before the equaliser arrived after 59 minutes.
Tymon found space down the left to deliver a fine cross and Lowe met it with power from six yards out to give Dieng no chance.
Isaiah Jones almost restored Middlesbrough’s lead after charging through from his own half.
But Rushworth’s error allowed Morgan Rogers to tee up fellow substitute Silvera for the winner and Boro survived the stoppage-time loss of Dieng to injury to hold on for a much-needed victory.