Ayr United gained revenge for their recent League defeat at Balmoor with a fine victory in the Scottish Cup.
David Dunn fired the visitors in front with a superb 25-yard strike in the 20th minute.
It was no surprise when Ayr broke away 15 minutes from the end to seal their victory, Jerome Vareille racing clear and shooting low into the far corner.
Ayr United travel to high flying First Division side St Johnstone in the third round of the tournament.
Peterhead: Kelly, Buchan, Perry, Tully (Mcdonald 62), Gilfillan, Cameron, Sharp, Wood, MacAulay, Linn, McKay (Cowie 62). Subs Not Used: Youngson, McInally, McCafferty.
Booked: Cowie, MacAulay.
Ayr United: Brown, Caddis (Casey 77), Lowing, Forrest, Campbell, Robertson, Strain, Stevenson, Vareille (Friels 82), Weaver, Dunn. Subs Not Used: Brian Reid, Walker, Johnson. Sent Off: Stevenson (90).
Booked: Dunn, Stevenson, Campbell. Goals: Dunn 20, Vareille 75.
Ref: S MacDonald