Substitute Anderson opened the scoring at McDiarmid Park
Steven Anderson helped put his former team Dundee United to the sword as St Johnstone squeezed through to the Co-operative Insurance Cup semi-finals.
Making only his fifth appearance of the season, the defender headed his team in front on 72 minutes.
Moments later visiting player Darren Dods scored an own goal from Liam Craig's free-kick.
United's Prince Buaben set up a frantic finish after looping a header in over Graeme Smith on 81 minutes.
There was a surprise name on team sheet for St Johnstone, when former Rangers and Hibernian forward Jonatan Johannson was included after signing as a free agent for the Perth club.
The Finn, and strike partner Kenny Deuchar both missed good chances to open the scoring inside 10 minutes as the Saints enjoyed the bulk of possession.
United worked their way into the game but only Danny Cadermarteri managed to test goalkeeper Smith in the opening period with a shot on 20 minutes, while David Goodwillie went just wide with a long range drive.
The home side could have gone ahead on the half-hour mark, but Johansson and Murray Davidson got in each other's way trying to head home Liam Craig's cross.
Chris Millar also mis-hit a first-time effort straight at United goalkeeper Steve Banks from Deuchar's knockdown, before he himself shot over the bar from the edge of the box.
Into the second half and Anderson opened the scoring from a fine corner delivered by Craig.
And Craig was involved again on 74 minutes as Saints doubled their lead - his delivery from a free-kick causing trouble in the United defence and flicking off Dods past his own goalkeeper.
With nine minutes to go Buaben ensured a nervy finish, with a header high over Smith, but the Scottish Premier League newcomers held on to dump last season's beaten finalists.
St Johnstone manager Derek McInnes: "I'm very pleased it was hugely competitive as you would expect from a derby game with a lot at stake.
"We had a number of injuries but credit to the ones who came in as there wasn't a single failure tonight.
"I thought we started better and forced them back and to a man I was delighted with the performance.
"We're one step closer to another cup final and that's something to look forward to."
Dundee United manager Craig Levein: "We didn't play well enough to win the match or show that there was a gap in quality.
"So I think St Johnstone deserved to win, all credit to them - although I think we scored both their goals.
"But they put the balls into dangerous areas to get the goals and I'm more disappointed that we gave away the free-kicks where we did."
90:00+4:11 The referee brings the game to a close.
90:00+1:30 Shot from 20 yards by Garry Kenneth.
90:00+0:55 Daniel Grainger takes a shot.
90:00 Darren Dods concedes a free kick for a foul on Kenny Deuchar. Daniel Grainger takes the direct free kick.
89:29 The assistant referee signals for offside against David Goodwillie. Graeme Smith takes the free kick.
87:00 Substitution Kevin Moon replaces Jonatan Johansson.
86:39 The ball is swung over by David Goodwillie, clearance by Daniel Grainger.
84:07 Header from close in by Danny Cadamarteri misses to the right of the goal.
83:08 Corner taken by Craig Conway.
82:02 Booking Graeme Smith receives a yellow card.
81:16 The assist for the goal came from Michael Kovacevic.
81:16 GOAL - Prince Buaben:St Johnstone 2 - 1 Dundee Utd Prince Buaben finds the net with a headed goal from close range. St Johnstone 2-1 Dundee Utd.
78:00 Substitution Craig Conway comes on in place of Daniel Swanson.
75:30 GOAL - Darren Dods:St Johnstone 2 - 0 Dundee Utd Headed own goal by Darren Dods. St Johnstone 2-0 Dundee Utd.
74:47 Liam Craig takes the free kick.
74:47 Substitution Damian Casalinuovo replaces Mark Fotheringham.
74:47 Unfair challenge on Filipe Morais by Sean Dillon results in a free kick.
74:14 Free kick awarded for a foul by Daniel Swanson on Graham Gartland. Free kick taken by Graeme Smith.
72:35 Free kick awarded for a foul by Sean Dillon on Kenny Deuchar. The free kick is swung in left-footed by Liam Craig.
71:37 The assist for the goal came from Liam Craig.
71:37 GOAL - Steven Anderson:St Johnstone 1 - 0 Dundee Utd Steven Anderson grabs a headed goal from close in. St Johnstone 1-0 Dundee Utd.
70:53 Liam Craig takes a inswinging corner from the right by-line played to the near post,
68:00 Free kick awarded for a foul by Kenny Deuchar on Daniel Swanson. Free kick taken by Mark Fotheringham.
66:18 Substitution (St Johnstone) makes a substitution, with Filipe Morais coming on for Paul Sheerin.
65:37 Free kick awarded for an unfair challenge on Kenny Deuchar by Michael Kovacevic. Free kick crossed left-footed by Liam Craig.
65:04 The referee blows for offside. Garry Kenneth restarts play with the free kick.
61:18 Substitution (St Johnstone) makes a substitution, with Steven Anderson coming on for Kevin Rutkiewicz.
60:19 Foul by Murray Davidson on Daniel Swanson, free kick awarded. Daniel Swanson crosses the ball in from the free kick.
58:59 Unfair challenge on Kevin Rutkiewicz by Danny Cadamarteri results in a free kick. David MacKay restarts play with the free kick.
58:25 Chris Millar takes a shot from deep inside the box clearing the bar.
50:58 Header from deep inside the penalty area by Jonatan Johansson goes harmlessly over the crossbar.
49:23 The assistant referee flags for offside against Danny Cadamarteri. Graeme Smith takes the free kick.
45:32 Foul by David Goodwillie on Kevin Rutkiewicz, free kick awarded. Direct free kick taken by David MacKay.
45:01 The referee blows his whistle to start the second half.
45:01 Substitution Darren Dods replaces Andy Webster.
Half Time
45:00+0:23 The ref blows to end the first period.
40:44 Shot on goal by Kenny Deuchar from just inside the area clears the crossbar.
40:17 Michael Kovacevic gives away a free kick for an unfair challenge on Kenny Deuchar. Direct free kick taken by Daniel Grainger.
36:58 Danny Cadamarteri concedes a free kick for a foul on Murray Davidson. Daniel Grainger restarts play with the free kick.
36:38 Chris Millar takes a shot. Steve Banks makes a save.
34:16 Foul by Murray Davidson on Prince Buaben, free kick awarded. Sean Dillon takes the direct free kick.
32:07 Effort from outside the area by David Goodwillie goes wide right of the goal.
31:03 Free kick awarded for a foul by Kenny Deuchar on Garry Kenneth. Andy Webster restarts play with the free kick.
30:21 Headed effort on goal by Murray Davidson from inside the penalty box misses to the right of the goal.
24:54 Daniel Swanson has an effort at goal from just inside the box that misses to the right of the goal.
23:56 Inswinging corner taken right-footed by Daniel Swanson from the left by-line to the near post, clearance by Kenny Deuchar.
22:40 Murray Davidson concedes a free kick for a foul on Prince Buaben. Andy Webster takes the indirect free kick.
20:43 Shot from just outside the area by Danny Cadamarteri goes over the bar.
19:50 Liam Craig has an effort at goal from just outside the area which goes wide of the left-hand post.
18:23 Free kick awarded for an unfair challenge on Andy Webster by Jonatan Johansson. Direct free kick taken by Andy Webster.
16:31 Unfair challenge on Daniel Grainger by Danny Cadamarteri results in a free kick. Free kick taken by Graeme Smith.
15:09 The assistant referee signals for offside against Kenny Deuchar. Free kick taken by Steve Banks.
13:45 Free kick awarded for a foul by Kenny Deuchar on Andy Webster. Steve Banks takes the direct free kick.
12:52 Prince Buaben gives away a free kick for an unfair challenge on Paul Sheerin. Graeme Smith takes the direct free kick.
11:10 Mark Fotheringham concedes a free kick for a foul on Murray Davidson. Liam Craig crosses the ball in from the free kick, Michael Kovacevic manages to make a clearance.
9:07 Shot on goal by Jonatan Johansson from just inside the area clears the crossbar.
7:41 Foul by Murray Davidson on Steve Banks, free kick awarded. Free kick taken by Steve Banks.
7:01 Liam Craig takes a outswinging corner.
5:52 The official flags Danny Cadamarteri offside. Daniel Grainger restarts play with the free kick.
4:25 Headed effort from inside the area by Kenny Deuchar misses to the left of the target.
3:56 Danny Cadamarteri challenges David MacKay unfairly and gives away a free kick. Graeme Smith takes the direct free kick.
3:40 The official flags Jonatan Johansson offside. Indirect free kick taken by Garry Kenneth.
2:54 Free kick awarded for a foul by Danny Cadamarteri on Kevin Rutkiewicz. David MacKay restarts play with the free kick.
1:10 Liam Craig concedes a free kick for a foul on Mark Fotheringham. Steve Banks takes the direct free kick.
0:12 Unfair challenge on Kenny Deuchar by Sean Dillon results in a free kick. The free kick is swung in left-footed by Liam Craig, clearance made by Danny Cadamarteri.
0:00 The ref blows the whistle to start the match.
Live text and data provided by The Press Association.
Bookmark with:
What are these?