A late Paul Sheerin penalty broke Keith hearts as Arbroath scraped through to the fourth round of the Scottish Cup 1-0.
Though Arbroath had the obvious edge, Keith were not overwhelmed and striker Cammy Keith should have opened the scoring with a volley from six yards that he scuffed wide.
Arbroath turned the screw after the break through Brian Kerr, the midfielder's snap-shot volley forcing a reactionary save from Andrew Shearer.
The Scottish Division Two side continued to press and Craig Wedderburn hit the bar with a header from six yards.
But just when it seemed Keith would secure a replay, Kris Niddrie brought down Steven Doris inside the box in stoppage time.
Sheerin slotted the penalty past Shearer and Niddrie's late sending off eliminated all hope of Keith grabbing a famous draw.