Lee Tomlin’s last-gasp free-kick saw Bristol City come from behind to take all three points in this battle of the Championship strugglers – and shove Fulham further into relegation trouble.

The dismal defeat leaves Slavisa Jokanovic’s side only a single point above the drop zone. The Whites were punished for failing to build on the perfect start after talismanic forward Ross McCormack bent in a brilliant opener. City hit back with a first goal of the campaign from midfielder Marlon Pack and stole all three points courtesy of a stunning 25-yard winner from Tomlin.

The Whites have had no problem finding the net – they remain one of the division’s leading scorers – but they have been vulnerable at the other end from the start of the season. A leaky defence cost Kit Symons his job when Birmingham City hit five in SW6 back in November and no amount of tinkering, either from the caretaker bosses who succeeded the Welshman or Jokanovic, has been able to solve the problem.

Andy Lonergan was forced into a first-minute save by a daisycutter from Joe Bryan and, even though McCormack went straight up the other end to give the hosts the lead, Fulham’s soft centre was ultimately exposed. The Scot produced a splendid finish to lob Richard O’Donnell from the acutest of angles after he had deftly brought down a hopeful forward punt from Michael Madl.

The goal galvanised Fulham and they should have gone further in front as Scott Parker and Tom Cairney tested the Robins’ goalkeeper. City, by contrast, were restricted to openings fashioned from set plays with Aden Flint nodding an Adam Matthews’ long throw wide. Lee Johnson, a boyhood Fulham fan, made a double change at half-time and Tomlin – moved infield from the wing – nearly brought them level with a speculative drive that brought a fine save from Lonergan.

One of the substitutes, Peter Odemwingie, put a fearful Fulham on the back foot with his pace and suddenly it was the away side who were calling the shots.

Aden Flint headed Adam Matthews’ long throw wide while Cottagers defender Luke Garbutt was on hand to clear a free-kick from near his own line.

Bristol City manager Lee Johnson made two half-time substitutions to inject some life into his side. The decision almost reaped immediate rewards as Tomlin, moved from the wing to a central position, forced Lonergan into a full-stretch save in the 47th minute.

Peter Odemwingie, who has joined on loan from Stoke, was also introduced and suddenly it was a new Robins side who were pushing the dominant hosts back. After Moussa Dembele had failed to control before he looked set to make it 2-0 from eight yards, Pack rifled home from 25 yards to level matters – and Fulham became far more jittery as the travelling fans urged their side forward.

Fulham’s fluent passing became a thing of the past and, just when it seemed like they were content to hang on for a share of the spoils, Tomlin stepped up to curl in a magnificent free-kick and deepen the Cottagers’ relegation concerns.

FULHAM (3-5-2): Lonergan; Madl, Burn, Amorebieta; Fredericks, Garbutt (Ream 77), Parker (O’Hara 80), Tunnicliffe, Cairney; McCormack, Dembele (Woodrow 85). Subs (not used): Bettinelli, Richards, Hyndman, Smith.

BOOKED: Madl, Fredericks.

GOAL: McCormack (2).

BRISTOL CITY (4-4-2): O’Donnell; Matthews (Ayling 90), Golbourne, Baker, Flint; Freeman (Decordova-Reid 45), Bryan, Pack, Tomlin; Wilbraham, Kodija (Odemwingie 45). Subs (not used): Fielding, Pearce, Wagstaff, Agard.

BOOKED: Pack.

GOALS: Pack (69), Tomlin (90).

REFEREE: Phil Gibbs (West Midlands).

ATTENDANCE: 20,316