Raith Rovers survived a fine first half performance from third division underdogs Montrose to ease their way into the second round of the Scottish Communities League Cup.
Montrose were up for the tie from the first whistle and more than held their own in the opening period, then shocked their first division opponents by taking the lead in 20 minutes.
Raith failed to clear a Dougie Cameron corner and after David Dimilta had a shot blocked, Jamie Winter hammered the ball home for a goal on his debut.
Montrose hit on the break in 28 minutes and almost scored again.
Dimilta was denied by David McGurn and Martin Boyle just failed to net from the rebound.
Raith equalised in 32 minutes when Iain Williamson headed home a Joe Hamill corner.
John Baird hit the post for Raith in 37 minutes, then right on the half-time whistle, an Allan Walker chip was headed off the Montrose line by Alan Campbell.
Raith took a grip of the tie with two goals early in the second half.
In 52 minutes, Walker headed home a Hammill cross, then three minutes later, Baird headed in from a Williamson cross.
Mayhem ensued in 63 minutes with an incident, which saw Montrose reduced to nine men.
Jonathan Smart collected a second booking for a high challenge on Danny Thomson, but the challenge sparked a bust-up which appeared to involve every outfield player.
The referee consulted his linesman and booked Winter of Montrose and Brian Graham and Baird of Raith, before finally red-carding Montrose’s Stephen McNally.
With a two-man advantage, Raith only added one further goal 12 minutes from time when Walker set up Thomson to shoot into the bottom corner.
Raith boss John McGlynn said, “I have a lot to be pleased about. We made it difficult for ourselves by going behind and it was a test of character.
“Our fans will know that we have never won a competitive game on plastic, so I’m pleased to have done that.
Montrose manager Ray Farningham said, “We can take positives from the first half. If we play like that for 90 minutes when the league starts we will be OK.”