Luke Varney’s emphatic last-minute header saw Ipswich Town win their final home game of the season 3-2 against already-relegated MK Dons.

The Blues twice took the lead, but were twice pegged back as David McGoldrick’s side-footed opener (16) and Brett Pitman’s glancing header (69) were cancelled out by Alex Revell’s penalty (45+) and close-range finish (74).

Substitute Varney converted Myles Kenlock’s cross at the death though as Mick McCarthy’s men avoided becoming the first team in the club’s history to go an entire season without scoring three times or more on home turf.

Town ended a seven-game winless streak to remain eighth in the Championship table heading into next Saturday’s season-finale at Derby, while MK Dons’ own winless streak extended into double figures.

The Blues may have conceded two typically sloppy goals, but an experimental starting line-up – which included some youthful exuberance in the form of full-backs Josh Emmanuel and Kenlock in particular – at least provided some much-needed entertainment value in this dead rubber.

With Town unable to make the play-offs and MK Dons already preparing for life back in League One, both managers named experimental starting line-ups.

Mick McCarthy made five alterations to his team, following a goalless draw at Middlesbrough, and handed starts to the young trio of Emmanuel, Kenlock and Teddy Bishop, the latter’s first of an injury-hit campaign.

MK Dons boss Karl Robinson made six changes to his team, following a 4-1 defeat at home to Brentford, and also named three teenagers on his substitutes’ bench.

Following a cagey start to the match, Town really began to click. Adventurous young full-backs Emmanuel and Kenlock provided an added attacking dimension, Kevin Bru sprayed some excellent long passes from deep, while the front three of Freddie Sears, David McGoldrick and Liam Feeney linked up well.

One McGoldrick driving run was halted by a last-ditch tackle, then Emmanuel’s strong run and cross ended with Kenlock’s looping header dropping on the roof of the net.

Feeney’s dangerous cross was nodded behind, then McGoldrick’s shot was blocked for another corner. You sensed a home goal was coming and it arrived in the 16th minute thanks to a combination of good attacking play and some terrible defending.

Feeney passed the ball inside to Sears, the latter stood a cross up to the far post and McGoldrick took advantage of some slack marking to convert with a side-footed volley.

It was only the sixth goal time – in 25 games – that Town had scored a first-half goal at Portman Road this season and, for a spell, it looked as though they might overwhelm the visitors.

It required a smart double save from Charlie Burns to prevent the lead being doubled in the 20th minute after yet more good work from Emmanuel and Kenlock. Town’s powerful right-back spun his marker before picking out McGoldrick, the latter’s shot saved down low. Kenlock kept the ball in play and picked out Bishop, the latter’s well-struck shot also kept out by the keeper.

Ipswich failed to really take the game by the scruff of the neck from here though and there were a couple of lapses in concentration which were a sign of what was to come.

First, Daniel Powell was allowed to drift inside and shoot just wide. Then, after captain for the day Cole Skuse passed a free-kick straight to the opposition, Kenlock had to race back and defend a rapid counter-attack well.

MK Dons grew in confidence as Norwich loanee Murphy dragged a shot across the face of goal after a driving run down the left.

The equaliser arrived in first-half stoppage-time after another series of mistakes by the home team. McGoldrick gave the ball away sloppily high up the field, Murphy skipped past Skuse with ease and then McGoldrick, racing back in an attempt to atone for his earlier error, tripped Samir Carruthers in the area. Revell converted the resultant penalty.

MK Dons started the second period brightly and Dean Gerken had to make a smart stop from Carruthers.

Ipswich began to find their stride again around the hour mark though and Bishop put a shot just wide on the stretch, after some good footwork in the area, before Sears’ angled attempt was pushed around the post.

Town regained their earlier lead in the 69th minute when Pitman – seven minutes after coming on as a sub – met Kevin Bru’s crossed free-kick with a fine glancing header in a crowded box.

The lead lasted just five minutes though as, once again, the Blues switched off and were punished. Murphy’s lofted free-kick from deep left evaded everyone in the area and Revell crept around the back to side-foot home from close-range.

It looked like it would be another frustrating afternoon at Portman Road, but then, in the last minute, substitute Varney met Kenlock’s curling cross to emphatically head high into the net.

IPSWICH TOWN (4-2-3-1): Gerken; Emmanuel, Smith, Berra, Kenlock; Skuse (cpt), Bru; Sears, Bishop (Pitman 62), Feeney (Varney 75); McGoldrick

Unused subs: Bialkowski, Digby, Foley, McDonnell, Hyam.

MK DONS (4-2-3-1): Burns; Baldock, Long, Walsh, Lewington (cpt); Potter, Carruthers (Baker 66); Powell, Bowditch (Maynard 78), Murphy; Revell (Furlong 88).

Unused subs: Spence, McFadzean, Jackson, Kasumu.

Attendance: 19,631 (489 away)

Referee: Keith Stroud