Substitute Jordan Bove scored his first senior goal as Oldham beat Bradford 1-0 to progress to the second round of the Johnstone's Paint Trophy.
A cagey tie was heading towards a penalty shoot-out when teenage striker Bove pounced from close range after 88 minutes.
Bradford were the first side to go close as Oliver McBurnie headed wide from Alan Sheehan's inviting corner.
Jason Kennedy then wasted another chance for the visitors, but Oldham threatened twice before the break when James Dayton and Amari Morgan-Smith both narrowly missed the target.
Bradford were unlucky to hit the woodwork after 58 minutes with midfielder Mark Yeates slamming his 25-yard drive against the foot of the post.
Oldham responded with a spell of pressure and Carl Winchester's dipping, long range shot forced a save from goalkeeper Jordan Pickford.
The clincher came when Pickford could only parry Winchester's cross-shot, allowing Bove to smash the loose ball high into the net from six yards out.