West Ham United ended their Barclays Premier League South campaign in heartbreaking fashion with a 1-0 loss at Portsmouth on Tuesday evening.

Greece international striker Theofanis Gekas won the game for Pompey with a moment of magic just seconds from the end of the game, taking a touch on the edge of the Hammers' penalty area before unleashing an unstoppable right-foot drive past the helpless Peter Kurucz. Defeat was very harsh on the visitors, who could easily have won the game themselves.

First team coach Steve Clarke, Academy director Tony Carr and goalkeeping coach Ludek Miklosko were among the 257-strong crowd who watched an intriguing, if not exciting, game at Havant and Waterlooville FC's West Leigh Park that was settled by Gekas' 94th minute strike.

Reserve team manager Alex Dyer again named a relatively inexperienced side for the fixture. Hungary Under-21 goalkeeper Kurucz and captain-for-the-night Zavon Hines were the only non-teenagers in the side. With regular skipper Bondz N'Gala missing with an ankle injury, Nick Barrett moved to right-back, with Matthew Fry in the centre of the defence alongside Holmar Orn Eyjolfsson.

For the home side striker Gekas, who is on loan from German side Bayer Leverkusen and was the Bundesliga's top scorer with VfL Bochum in 2006/07, led the forward line, with former Barnet and Reading defender Linvoy Primus at the back and ex-Reading goalkeeper Jamie Ashdown between the sticks.

West Ham began much the brighter of the two sides on a warm, sunny evening on the south coast and could have taken the lead in just the fourth minute. Superb interplay from Daniel Kearns and Balint Bajner down the right wing was followed by Anthony Edgar lifting a neat pass over the Pompey defence to Hines, but the striker could only drive a rising shot across the face of Ashdown's goal.

Edgar, twice, and Ollie Lee both saw shots blocked himself as the Hammers looked for the opening goal but it was not long before Portsmouth, with withdrawn striker Gautier Mahoto and left-back Andre Blackman to the fore, took the intiative.

As Dyer's youngsters struggled to maintain possession in midfield, Pompey began to threaten fairly regularly. French 17-year-old Mahoto looked the home side's most likely scorer, smashing a volley narrowly wide of Kurucz's far post after Eyjolfsson had blocked his initial shot, then screwing an effort off-target after Gael Nlundulu's cross had deflected into his path off Fry.

Central defender Luke Wilkinson should have scored for Portsmouth on 27 minutes, but he could only divert his header from Nlundulu's right-wing free-kick straight at Kurucz from six yards. Seconds earlier, Hammers left-back Ashley Miller had been booked for an untidy late challenge on Blackman.

After Mahoto had again shot wide from a decent position, West Ham gradually worked their way back into the game, with Miller dragging a long-range effort wide after winning a fine challenge in the midfield, while the unmarked Bajner should have done far better when Kearns' cross dropped to him inside the penalty area.

In between those two chances, Lee had a goal correctly ruled out for offside. Kearns curled a corner into the penalty area and Fry hooked goalwards, but the midfielder was beyond the last defender when he poked the ball past Ashdown from inside the six-yard box.

Dyer made a single change at half-time, bringing on Colombian-born forward Cristian Montano for Bajner. Three minutes after the break, Lee tested Ashdown with a rising 25-yard shot that the goalkeeper could only push around the post for a corner, although it may have already been flying wide of the target.

In truth, the second half was far less incident-packed than the first, at least until the final seconds, with neither side creating more than a handful of goalscoring opportunities.

Hines wasted the first of a number of decent chances on the hour-mark, ghosting past right-back Tero Mantyla with a neat piece of skill but shooting wastefully wide of the near post instead of cutting the ball back into the path of his colleagues.

Barrett became the second Hammer to be booked on 65 minutes for hauling back the lively Mahoto before Lee went close with a well-struck left-foot shot from 25 yards. Later, Eyjolfsson also saw yellow for a foul on Gekas.

The game finally livened up again in the closing 20 minutes. First, Pompey substitute Nadir Ciftci gifted possession to Lee with his first touch. The midfielder fed Hines with a neat through ball, only for Ashdown to block the captain's shot with his legs.

Seconds later, Gekas stung Kurucz's fingertips with a rising shot on the turn, showing a glimpse of the international class that has seen him score 14 times in 38 appearances for Greece.

West Ham, who handed a reserve team debut to left-back Jordan Brown with 15 minutes remaining, continued to look the more likely winners and should have won the game with three minutes remaining. However, instead of finding the bottom corner of Ashdown's net, Hines could only drag his shot wide of the far post from 15 yards.

Into the first minute of added time and Hines missed another superb chance, latching on to Montano's flick-on but delaying too long and allowing Wilkinson to block his shot behind for a corner.

Dyer's Hammers have ended the season with 22 points from their 16 games and currently sit in fifth place in the league table, with Portsmouth moving above West Ham on goal different thanks to Gekas' late, late winner.

West Ham United reserves: Kurucz, Barrett, Miller (Brown 75), Eyjolfsson, Fry, Kearns, Lee, Grasser, Edgar, Bajner (Montano 46), Hines
Subs: Street, Abdulla, McNaughton

Portsmouth reserves: Ashdown, Mantyla, Blackman, Primus, Wilkinson, Nlundulu (Bogard 71), Pack, Hurst, Navas Alors (Ciftci 71), Gekas, Mahoto
Subs: Stewart, Gazet du Chattelier, Ryan