Kaid Mohamed's extra-time winner at a foggy Edgar Street broke Hereford hearts to send Cheltenham through to the third round of the FA Cup.
Mohamed's header earned the Robins a lucrative, televised home tie against Premier League Everton on 7 January.
Cheltenham went ahead from Shaun Harrad's controversial penalty after Andy Gallinagh had been penalised for his challenge on Jermaine McGlashan.
But Sam Clucas's shot squirmed home to level the tie on 74 minutes.
Hereford boss Martin Foyle was part of the Port Vale side that dumped Everton out of the FA Cup 16 years ago, even scoring at Goodison Park.
But, despite another spirited display from his Blue Square Bet Premier side against their League Two opponents, his hopes of setting up a rematch ended.
In a tense first half low on drama, perhaps influenced by the size of the prize on offer, there was little cause for excitement.
Hereford were not helped by 11-goal top scorer Ryan Bowman limping out of the tie after just 15 minutes with a medial knee ligament injury.
But the Bulls did have a Clucas shot saved low down by visiting goalkeeper Scott Brown, while Will Evans scuffed another left-footed shot just wide.
For Cheltenham, Darren Carter had a 25-yard free-kick comfortably saved low by James Bittner, who then had to be alert to tip over McGlashan's looping header.
But the game erupted into life in first-half injury-time.
Martin Foyle Hereford United manager
“It's a deflated dressing room. We're devastated to have been just six minutes from penalties”
Brown had pulled off a brilliant save to deny Clucas's left-foot shot and Cheltenham then went straight down the other end and won a penalty.
Cheltenham old boy Gallinagh was adjudged to have fouled McGlashan and Harrad powered the resulting spot-kick straight down the middle.
As the fog descended on Edgar Street, it seemed Hereford's hopes were starting to disappear. But Clucas's scrambled effort with 16 minutes left slid inside Brown's right-hand post to get them back on level terms.
Cheltenham nearly won it late on when Bittner saved well from Jake Taylor, but, with the fog worsening, the game went to extra-time.
And the visitors finally won it six minutes from time when, from Billy Jones's superb left-wing cross, substitute Mohamed rose at the near post to steer his header just inside Bittner's left post.
VIEWS FROM THE DRESSING ROOM
Hereford United boss Martin Foyle told BBC Hereford & Worcester:
"It's a deflated dressing room. We're devastated to have been just six minutes from penalties.
"The lads have given me absolutely everything tonight and they're out on their feet. And, to add insult to injury, Ryan Bowman has tweaked his medial ligaments.
"It all changed for us in 60 seconds just before the break. Their keeper pulled off a fantastic save from Sam Clucas and then they go down the other end and score.
"Was it a penalty? I'd like to see it again. But Andy Gallinagh has got the wrong side and, if the lads' bought a penalty then he's bought a penalty. That's cup-tie football for you."
Cheltenham Town manager Mark Yates told BBC Radio Gloucestershire:
"When the draw was made, I said we wanted someone from the league below at home, but the worst team we could have got was Hereford.
"We've got a terrible record against them and I hate coming here. It took me an hour and a half to get here and I only live 30 miles away.
"There was a bit of pressure on us as the chairman was ramming it down my throat about just how much we needed the TV money in the next round. But the players can go and enjoy their big day now and they deserve it.
Cheltenham forward Shaun Harrad on the penalty decision:
"I was only 10 yards away and you could see immediately that it was a penalty. We'd have been disappointed if it hadn't been given.
"He's nutmegged him and brought him down. It was a clear penalty for me.
"[The booing] was just a bit of sour grapes in the end as he was a real threat to them first half."
- 01 Bittner Booked
- 02 Gallinagh (Perry - 115' )
- 03 Heath
- 06 Graham
- 14 Stam Booked
- 04 Pell
- 17 Evans Booked (Watkins - 60' Booked )
- 18 Clucas
- 21 O'Keefe
- 22 Smikle
- 19 Bowman (Marsh - 16' )
- 12 Hanford
- 07 Watkins
- 11 Clist
- 16 McQuilkin
- 15 Marsh
- 26 Perry
- 01 Brown
- 03 Jones
- 06 Elliott
- 15 Bennett
- 22 Jombati
- 04 Carter
- 11 McGlashan (Pack - 68' )
- 16 Penn (Mohamed - 81' )
- 18 Taylor
- 14 Harrad (Duffy - 72' )
- 26 Zebroski
- 12 Roberts
- 02 Lowe
- 07 Pack
- 08 Deering
- 20 D'Ath
- 09 Duffy
- 23 Mohamed
Live Text Commentary
The match has finished after extra time.120:00 +0:36
Free kick awarded for a foul by Darryl Duffy on Luke Graham. Harry Pell restarts play with the free kick.119:11
Unfair challenge on Luke Graham by Darryl Duffy results in a free kick. Harry Pell takes the direct free kick.117:16
Unfair challenge on Joshua O'Keefe by Kaid Mohamed results in a free kick. Joe Heath restarts play with the free kick.114:50 Substitution
Substitution Kyle Perry on for Andy Gallinagh.113:38
Billy Jones provided the assist for the goal.113:38 Goal scored
Goal! - Kaid Mohamed - Hereford 1 - 2 Cheltenham Kaid Mohamed grabs a headed goal from close in. Hereford 1-2 Cheltenham.112:21
A cross is delivered by Chris Zebroski, Joe Heath makes a clearance. Shot by Marlon Pack from a long way out goes over the target.111:26
A cross is delivered by Marlon Pack, clearance made by Joshua O'Keefe.110:52
Corner taken by Billy Jones, clearance made by Stefan Stam.110:44
Centre by Chris Zebroski, blocked by Joe Heath.108:40
Billy Jones takes a outswinging corner from the left by-line played to the near post, Steve Elliott takes a shot. Save by James Bittner.106:48
Steve Elliott concedes a free kick for a foul on Joshua O'Keefe. Free kick taken by James Bittner.106:16
Harry Pell gives away a free kick for an unfair challenge on Kaid Mohamed. Free kick taken by Billy Jones.105:36
A cross is delivered by Sido Jombati, clearance by Harry Pell.105:01
The referee blows to start the second half of extra time.104:35
Free kick awarded for a foul by Stefan Stam on Chris Zebroski. Jake Taylor has an effort direct from the free kick.103:57
The ball is sent over by Kaid Mohamed, Andy Gallinagh makes a clearance.103:32
Jake Taylor takes a shot. Blocked by Brian Smikle.101:23
Handball decision goes against Sido Jombati. James Bittner restarts play with the free kick.
The ball is delivered by Andy Gallinagh, clearance by Kaid Mohamed.98:53
Free kick awarded for an unfair challenge on Samuel Clucas by Steve Elliott. Free kick taken by James Bittner.97:37
The ball is swung over by Billy Jones.95:57
The ball is swung over by Chris Zebroski, blocked by Harry Pell.95:13
Phil Marsh sends in a cross, clearance made by Alan Bennett.93:29
Free kick awarded for a foul by Jake Taylor on Andy Gallinagh. Free kick taken by James Bittner.91:55
The ball is swung over by Billy Jones, James Bittner makes a save.91:42
Billy Jones sends in a cross, clearance by Andy Gallinagh.91:10
Joe Heath crosses the ball, clearance made by Steve Elliott.90:00 +3:48
The whistle goes for the end of normal time.90:00 +2:17
Outswinging corner taken left-footed by Billy Jones, Marley Watkins makes a clearance.88:23
The official flags Brian Smikle offside. Free kick taken by Scott Brown.87:28
Jake Taylor takes a shot. James Bittner makes a comfortable save.85:00
Foul by Chris Zebroski on Samuel Clucas, free kick awarded. Direct free kick taken by James Bittner.81:26
Darren Carter takes a shot. Joshua O'Keefe gets a block in.80:38
Unfair challenge on Harry Pell by Marlon Pack results in a free kick. Stefan Stam takes the direct free kick.80:08 Substitution
Substitution Russell Penn leaves the field to be replaced by Kaid Mohamed.77:51
Darryl Duffy is flagged offside by the assistant referee. Indirect free kick taken by James Bittner.76:33
Darryl Duffy is penalised for a handball. James Bittner restarts play with the free kick.75:27
The ball is delivered by Sido Jombati.73:50 Goal scored
Goal! - Samuel Clucas - Hereford 1 - 1 Cheltenham Cross/shot scored by Samuel Clucas. Hereford 1-1 Cheltenham.73:36
Samuel Clucas crosses the ball, Sido Jombati makes a clearance.73:05
Centre by Phil Marsh, Steve Elliott makes a clearance. Inswinging corner taken by Samuel Clucas from the right by-line played to the near post, Darryl Duffy makes a clearance.72:09
Marley Watkins fouled by Marlon Pack, the ref awards a free kick. Free kick crossed by Samuel Clucas, clearance by Steve Elliott.71:12 Substitution
Substitution Darryl Duffy replaces Shaun Harrad.70:56
Shot on goal by Andy Gallinagh from just inside the area goes over the target.69:22
Marley Watkins gives away a free kick for an unfair challenge on Alan Bennett. The free kick is delivered right-footed by Marlon Pack from right channel, Luke Graham manages to make a clearance.67:55 Substitution
Substitution Marlon Pack on for Jermaine McGlashan.67:06
Scott Brown restarts play with the free kick.67:06 Booking
Booking Marley Watkins goes into the referee's book.66:50
Marley Watkins challenges Russell Penn unfairly and gives away a free kick.66:17
Phil Marsh produces a cross, Sido Jombati manages to make a clearance.65:46
Jermaine McGlashan delivers the ball, brilliant save by James Bittner.65:22
Samuel Clucas takes a shot. Save by Scott Brown.64:57
Unfair challenge on Joshua O'Keefe by Russell Penn results in a free kick. Joe Heath takes the free kick.62:49
Outswinging corner taken from the left by-line by Billy Jones, Luke Graham manages to make a clearance.62:41
The ball is crossed by Sido Jombati, clearance made by Luke Graham.61:25
The ball is swung over by Shaun Harrad.59:37 Substitution
Substitution Marley Watkins replaces Will Evans.58:17
Foul by Chris Zebroski on Luke Graham, free kick awarded. James Bittner takes the direct free kick.57:47
Free kick awarded for a foul by Brian Smikle on Russell Penn. Scott Brown restarts play with the free kick.56:38
Chris Zebroski gives away a free kick for an unfair challenge on Andy Gallinagh. James Bittner restarts play with the free kick.55:14
Free kick awarded for an unfair challenge on Will Evans by Russell Penn. Free kick crossed by Will Evans, clearance by Alan Bennett.53:59
Corner taken left-footed by Samuel Clucas from the right by-line to the near post, Chris Zebroski makes a clearance.53:25
Free kick awarded for a foul by Steve Elliott on Phil Marsh. Will Evans crosses the ball in from the free kick, clearance made by Russell Penn.53:04
Russell Penn concedes a free kick for a foul on Harry Pell. James Bittner takes the free kick.52:51
Chris Zebroski delivers the ball, James Bittner makes a save.52:03
The ball is crossed by Billy Jones, save by James Bittner.51:48
Chris Zebroski crosses the ball, Luke Graham manages to make a clearance.50:19
Free kick awarded for an unfair challenge on Darren Carter by Joshua O'Keefe. Billy Jones takes the free kick.47:36
The ball is sent over by Jake Taylor, Joe Heath gets a block in.46:38
The official flags Phil Marsh offside. Steve Elliott restarts play with the free kick.45:50
Foul by Andy Gallinagh on Jermaine McGlashan, free kick awarded. Billy Jones takes the free kick.45:21
Free kick awarded for an unfair challenge on Andy Gallinagh by Jake Taylor. Andy Gallinagh restarts play with the free kick.45:01
The second half kicks off.45:00 +4:07 Half time
Half Time The players leave the pitch at half time.45:00 +4:05 Booking
Booking Stefan Stam is cautioned by the ref for dissent.45:00 +2:34 Goal scored
Goal! - Shaun Harrad - Hereford 0 - 1 Cheltenham Shaun Harrad scores a placed penalty. Hereford 0-1 Cheltenham.45:00 +1:14 Booking
Booking James Bittner booked for dissent.45:00 +1:03
Jermaine McGlashan fouled by Andy Gallinagh, the ref awards a Penalty.44:45
The ball is delivered by Brian Smikle, Samuel Clucas takes a shot. Brilliant save by Scott Brown. Inswinging corner taken left-footed by Samuel Clucas from the left by-line, clearance by Sido Jombati.44:18
Free kick awarded for an unfair challenge on Will Evans by Darren Carter. Luke Graham restarts play with the free kick.42:32
Darren Carter has an effort at goal from just outside the box which goes wide of the left-hand upright.41:57
Joshua O'Keefe concedes a free kick for a foul on Sido Jombati. Free kick taken by Darren Carter.39:03
Brian Smikle delivers the ball, Russell Penn makes a clearance.37:54
A cross is delivered by Phil Marsh, Scott Brown makes a fantastic save.37:18
Will Evans fouled by Chris Zebroski, the ref awards a free kick. James Bittner restarts play with the free kick.36:33
Centre by Jake Taylor, Jermaine McGlashan takes a shot. Save by James Bittner. Billy Jones takes the inswinging corner, clearance made by Stefan Stam.35:41
Will Evans has an effort at goal from outside the box which goes wide left of the target.32:44
Free kick awarded for an unfair challenge on Chris Zebroski by Will Evans. Direct effort from the free kick comes in from Darren Carter, save made by James Bittner.31:50
Corner taken left-footed by Billy Jones, save by James Bittner.31:37
Chris Zebroski crosses the ball, Joe Heath gets a block in.28:58
Chris Zebroski is flagged offside by the assistant referee. Indirect free kick taken by James Bittner.26:40
Direct free kick taken by Scott Brown.26:40 Booking
Booking Will Evans is cautioned.26:06
Will Evans gives away a free kick for an unfair challenge on Russell Penn.25:11
Chris Zebroski produces a right-footed shot from the edge of the area and misses to the left of the target.22:53
Brian Smikle is caught offside. Scott Brown restarts play with the free kick.22:20
Samuel Clucas takes a shot. Save by Scott Brown. Chris Zebroski challenges Will Evans unfairly and gives away a free kick. Free kick taken by Stefan Stam.21:24
Free kick awarded for an unfair challenge on Stefan Stam by Steve Elliott. James Bittner takes the direct free kick.20:49
Will Evans gives away a free kick for an unfair challenge on Russell Penn. Billy Jones takes the free kick.19:58
Free kick awarded for a foul by Joe Heath on Jermaine McGlashan. Direct free kick taken by Darren Carter.16:20
Free kick awarded for an unfair challenge on Jake Taylor by Harry Pell. Free kick taken by Billy Jones.15:07 Substitution
Substitution (Hereford) makes a substitution, with Phil Marsh coming on for Ryan Bowman.14:46
A cross is delivered by Jake Taylor, Stefan Stam manages to make a clearance.14:13
A cross is delivered by Jake Taylor, James Bittner makes a comfortable save.10:12
The ball is crossed by Billy Jones.9:58
Jermaine McGlashan produces a cross, clearance by Luke Graham.7:43
Jake Taylor crosses the ball.7:08
Billy Jones crosses the ball, clearance made by Luke Graham.6:22
The ball is delivered by Jake Taylor.5:12
Outswinging corner taken from the left by-line by Billy Jones, Andy Gallinagh manages to make a clearance.3:44
Jermaine McGlashan crosses the ball, clearance made by Stefan Stam.3:08
The ball is swung over by Brian Smikle, Alan Bennett makes a clearance.2:14
Corner taken by Samuel Clucas from the right by-line, Sido Jombati manages to make a clearance.0:56
Inswinging corner taken left-footed by Billy Jones from the right by-line, clearance made by Harry Pell.0:05
Unfair challenge on Harry Pell by Russell Penn results in a free kick. Andy Gallinagh takes the free kick.0:00
The ref blows the whistle to start the match.
Live data and text provided by our data suppliers