Substitute James Dayton smashed home the only goal of the game as Latics beat Carlisle United 1-0 to ensure they play League One football next season.
The winger, who had only been on the field ten minutes, fired home a solo goal 20 minutes from time as Latics moved up to 15th in Sky Bet League One and left the side now unbeaten in eight games.
Both sides started the first half in attacking fashion.
With three minutes on the clock, Gary Madine threaded a ball through to Brad Potts but as the midfielder took the ball past Paul Rachubka, he took it too far and could not get his resulting shot on target.
Minutes later, Latics maybe should have been awarded a penalty. David Worrall played in Wesolowski and the Australian looked to be brought down in the area but the referee waved away the protests.
Potts was causing a problem in and around the Latics area and James Wilson had to be alert to stop the midfielder as he looked to unleash an effort from the edge of the box.
Midway through the half, the visitors almost took the lead through Gary Harkins. The winger raced onto a ball into the box but a last ditch block denies him.
As the game started to go flat, Rachubka superbly tipped over Madine's 30 yard volley as the sides went into the break goalless.
Carlisle started the second half positively and Latics had to withstand minor pressure.
As Latics grew into the half, they thought they had took the lead just after the hour mark through substitute Joel Byrom. After a move that consisted of over 10 passes, the midfielder headed home a Wesolowski corss but the linesman had his flag up for offside.
Latics did not let that affect them and they did eventually take the lead 20 minutes from time. Substitute Dayton drove at the defence before wriggling past a couple of players and smashing the ball past Jordan Pickford to give the visitors the lead.
The home side struggled to get back into the game as Latics were in full control of proceedings.
Rachubka was forced into action five minutes from time. Danny Redmond volleyed from 25 yards but the goalkeeper parried wide.
Carlisle threw men forward in a bid to get back into the game and in the dying minutes of the game, goalkeeper Pickford almost snatched an equaliser for the Cumbrians, but Rachubka stood tall and kept out the danger.
The referee blew the full time whistle and the result means Latics are ensured of League One football next season!
Oldham Athletic: Rachubka, Brown, Lockwood, Wilson, Grounds, Worrall (Dayton 60'), Wesolowski, Smith, Harkins, Philliskirk (Byrom 60'), Clarke-Harris (MacDonald 75').
Subs not used: Dunfield, Winchester, Millar, Coleman.
Carlisle United: Pickford, Chantler, Amoo, Noble, Madine, Potts (Byrne 65'), Symington, Berrett, O'Hanlon, Brown, Novo (Robson 11', Redmond 71').
Subs not used: Fleming, Miller, Meppen-Walter, Chimbonda.
Goals: Carlisle United 0-1 Oldham Athletic (Dayton 70')
Attendance: 5,313 (733 visiting supporters)