Kilmarnock 0-1 St Johnstone
Brian Graham's second-half volley was enough to take St Johnstone through to the Scottish League Cup quarter-finals at the expense of Kilmarnock.
The on-loan Dundee United forward scored his third goal in four games when he improvised to hook the ball past Craig Samson.
Earlier, Alexei Eremenko and Sammy Clingan had threatened for Killie and Graham's header was blocked.
Eremenko was sent off for receiving a second booking 19 minutes from the end.
The playmaker had been the game's best player and his dismissal made the Ayrshire men's task even more difficult.
In the end, despite a few scares, the visitors held on to book a place in Wednesday's quarter-final draw.
Eremenko was behind almost all of Killie's goal threats. He hit an early 25-yard drive that Alan Mannus saved before setting up Josh Magennis to drive a shot wide from inside the box.
The Finn picked out Mark Connolly with a corner and the defender's close-range header drew a fine save from the goalkeeper.
Eremenko received his first booking from referee Steven McLean for diving outside the St Johnstone box after going past Murray Davidson.
He was back doing what he does best though with two efforts just wide of the post.
It was a completely different St Johnstone side that emerged from the tunnel in the second half, and Craig Samson was forced into saves from Graham and Dave Mackay before the former broke the deadlock.
O'Halloran's initial shot was blocked but when the ball eventually fell to the unmarked Graham he hooked it high past Samson and into the net from 10 yards out.
Eremenko was then given his marching orders for pulling back O'Halloran, but Kilmarnock continued to be a threat and Mannus saved well from another Connolly header.
Killie substitute Michael Ngoo had the ball in the net from Jamie Hamill's corner but it was ruled out for a foul by Magennis.
Liam Caddis could have made it two for the Perth side with a long-distance drive that went close late on.
St Johnstone manager Tommy Wright: "Away from home in the cup is always going to be difficult even though we've got a great record down here, it's eleven years or something since we've lost down here.
"It was a good response to the defeat on Saturday. Pleased to get the clean sheet and pleased to get the victory.
"They probably thought they had the better of the first half. We started the second half really well and deserved the goal.
"We are difficult to beat and we can always nick a goal so that is good ingredients to be a good cup side."
Kilmarnock manager Allan Johnston: "The referee has got to be 100% right. I went and asked him after the game what his thoughts were and he seemed to think it was Josh Magennis not Michael Ngoo that done the foul.
"But, obviously, we've had a look at the video and I don't see any foul.
"It's difficult for referees it happens so quickly but it's a big point in the game and you can't afford to get them decisions wrong.
"I'm delighted with the players the way they kept on going, the belief they showed. Just gutted for them with the result."