James McFadden smashed in an injury-time penalty to give Birmingham City their first win of the season.

Alex McLeish’s men were heading for a drab and morale-denting draw, only to be saved by David James’ late barge into Seb Larsson.

The ex-Aston Villa goalkeeper recklessly ran into Larsson as he came off his line to collect a Kevin Phillips’ cross. McFadden smashed his spot-kick into the top corner to lift St Andrew’s and give troubled Portsmouth another kick in the guts.

McLeish made one change to the Blues line-up, with Garry O’Connor replacing Lee Carsley in what was effectively a formation change for the home side.

A minute’s applause was held for Blues life-president and former chairman Jack Wiseman before the game.

Larsson had the first sniff of Portsmouth’s goal after six minutes when he rose to meet Franck Queudrue’s long ball into the box. The Swede headed the ball across the goal, but there was no-one to follow up the loose ball.

Blues’ desire to open their home account with an early goal was obvious. They pressed from the off but that also bred a little sloppiness and over-eagerness at times.

Keith Fahey collected Cameron Jerome’s ball on 12 minutes and closely marked by Bouba Diop, the Blues midfielder dropped his shoulder, eased himself into space but drove his low shot straight at James.

Larsson headed over in the 19th minute when he caught Gregory Vignal’s cross but was caught unsighted by the flight of the ball by Jerome, who jumped for the header himself.

James almost played himself into trouble ten minutes later. He skewed his clearance straight to O’Connor and spotting the veteran way off his line, the Blues striker tried to run the ball into space to tee-up a shot – but the defence covered quickly enough for the Scot to slice his low shot wide of James’ right-hand post.

Hayden Mullins released Niko Kranjcar in the 36th minute and the Croatian international tried to test Joe Hart with a long-range shot but the England goalkeeper had few problems.

Jerome wasted no time pressing Portsmouth in the opening minute of the second half and the ex-Cardiff City man watched his long-range shot sail just over James’ goal.

Stuart Parnaby came on for Blues in the 49th minute for Gregory Vignal, who limped off the field seemingly injured.

Jerome needed treatment himself a couple of minutes later when a robust challenge by Angelos Basinas, which resulted in him receiving a yellow card, left the Blues man crumpled for some time. He was unable to continue, with Phillips coming on in the 54th minute for his first Premier League appearance since May 2006.

Phillips’ arrival gave Blues fresh impetus but, before their improvement in form, they escaped in the 58th minute when Mullins raced into the penalty box and got onto the end of Kranjcar’s shot, although his instinctive effort went wide.

Portsmouth grew in confidence as the hosts wilted more and more before their late hurrah. Nadir Belhadj’s free-kick was punched back into the mix of bodies by Hart, with a hurried defensive clearance keeping Portsmouth at bay.

Blues hit back and were awarded a 65th minute free-kick when Phillips was brought down just outside the area. James needed to react swiftly, diverting Larsson’s free-kick over his bar.

The best move of the opening 75 minutes fell for Phillips. A quickly-taken McFadden free-kick was nodded down by Garry O’Connor, finding Phillips in space but the 36-year-old’s first-time shot was tipped around the post by James.

Christian Benitez, known as Chucho, replaced O’Connor in the 81st minute, a substitution regarded as far too late by many of the home fans. He immediately lifted them with a run from his own box which, while ultimately fruitless, showed a bit of the urgency and venom Blues had been lacking for much of the game.

As the first of four minutes of injury-time began, Blues were awarded a penalty. James rushed over to collect Phillips’ cross and barged into Larsson and although referee Lee Probert did not point to the spot immediately, the linesman flagged, prompting the Wiltshire official to make the decision.

McFadden despatched his spot-kick into the net and although there was still time for Portsmouth to react, with Kranjcar’s shot being saved by Hart just seconds later, Blues had the points.

Scorer: McFadden (pen, 90).

BIRMINGHAM CITY (4-4-2): Hart, Carr, Johnson, Queudrue, Vignal (Parnaby, 49), Larsson, Ferguson, Fahey, McFadden, Jerome (Phillips 54), O’Connor (Benitez ,81). Substitutes: Maik Taylor, McSheffrey, O’Shea, Carsley.

PORTSMOUTH (4-5-1): James, Wilson, Kaboul, Distin, Belladj, Vanden Borre (Utaka, h/t), Mullins, Mokoena, Bouba Diop (Basinas, 42), Kranjcar, Piquionne (Kanu, 80). Substitutes: Begovic, Hughes, Nugent, Ward.

Referee: Lee Probert (Wiltshire).

Bookings: Portsmouth – Basinas, James, Kaboul (all fouls).

Attendance: 19,922