Aaron Pugh's dramatic late winner saw Truro City through to the first round of the FA Trophy as they beat Gloucester City 3-2 at Treyew Road.
City almost threw the match away as they conceded two late goals.
Pugh had put Truro 2-0 up after two second-half headers but Scott Wilson pulled one back after 86 minutes.
A minute later Darren Mullings got an equaliser, but as extra time beckoned Pugh got on the end of a Scott Walker free-kick to seal the win.
Truro will host 2008 FA Trophy winners Ebbsfleet United from the Blue Square Bet Premier in the first round proper on 10 December.