Match ends, St. Mirren 3, Aberdeen 2.
St Mirren capitalised on Teddy Jenks' second-half red card to come from behind and beat Aberdeen to record a first Scottish Premiership win of the season.
Scott Brown and Christian Ramirez had Aberdeen in front at the break after Connor Ronan fired the home side ahead.
But after Jenks was shown a second yellow card for a late tackle on Jamie McGrath, St Mirren took control as Ronan added a fine second and Marcus Fraser sealed victory.
Up until Jenks' dismissal on 50 minutes, Aberdeen had looked like ending their run of seven games without a victory, following back-to-back league defeats without scoring.
Their defensive vulnerabilities were exposed after 14 minutes when the haphazard Lewis gifted possession away, and Ethan Erhahon slipped through Ronan to fire home via a deflection off David Bates.
But Aberdeen responded well as they dominated out wide to put dangerous crosses into the box and put St Mirren under pressure.
Teenage full-back Calvin Ramsay was again brilliant, and his free kick caused havoc in the St Mirren box, and eventually Ramirez touched the ball off Brown to swiftly level.
And another cultured free kick from Ramsay found a diving Ramirez who guided his header into the top corner to give Aberdeen - who had created other opportunities - a deserved lead.
But Jenks, who had been excellent in the first half, lost his composure early in the second period as he caught McGrath's foot when playing for the ball, having already been shown a yellow card for a trip on Fraser before the break.
It shifted the momentum of the game, as St Mirren boss Jim Goodwin brought on striker Curtis Main to go two up front and chase the match.
He was rewarded swiftly, thanks to the skill of his compatriots McGrath and Ronan. The former turned away from Scott Brown and fed his team-mate, whose delay on his strike bamboozled Bates and allowed him to guide home a fantastic equaliser.
And just four minutes later, they were ahead. McGrath was again involved as he found Fraser on the edge of the box, and his floated cross for Main was flapped at by Lewis, as the ball coasted into the back of the net.
Aberdeen boss Stephen Glass put on forwards Jay Emmanuel-Thomas and Austin Samuels in search of an equaliser, but it was St Mirren's Eamonn Brophy who had the best chance to add another goal, but he somehow forced the ball wide from just five yards out.
Man of the match - Connor Ronan
What did we learn?
Goodwin spoke pre-match about the need to get their season up and running after some promising performances - including four draws - had failed to yield a league win for St Mirren, so this will come as a boost.
In truth, their creative problems persisted, with their goal coming directly from Lewis' poor pass and a deflection, but they responded perfectly to the red card. Goodwin threw Main on and they attacked Aberdeen, and they could easily have scored more in the end.
As for Aberdeen, their defensive problems are holding them back. Lewis was again poor, with two errors leading directly to goals, and Glass must now be on the verge of turning to deputy Gary Woods.
Bates was also sloppy, having played Ronan onside for the first goal, and Main for the third, which allowed the St Mirren forward to put Lewis off as he raced out for the ball. He was also deceived too easily by Ronan for the equaliser.
In 20 games under Glass, Aberdeen have kept just one clean sheet. Jenks' sending off was clearly the turning point, but they failed to react and tighten up.
Up to that point, it had been a promising attacking display, with Ramsay, Hayes, Hedges and Jenks causing problems, as a more direct approach in the final third paid dividends. But until they get some composure out of possession, they will concede goals. No wins in eight games tells the story.
What they said
St Mirren manager Jim Goodwin: "There's no getting away that the sending off is a major turning point in the game. But I have to give credit to my players for moving the ball from side to side and creating those gaps."
Aberdeen manager Stephen Glass: "I thought we were okay up until the red card. Lost a couple of poor goals after it, and a poor one in the first half, that's it in a nutshell I think.
"I agree it's a red card. It's not something Teddy Jenks has meant to do, but it is a second yellow card."
St Mirren can build on this win with an away game at Livingston on Saturday (15:00 BST), while Aberdeen start a tough run of games at home to Celtic on Sunday (12:00)
- 22FraserBooked at 33minsSubstituted forFlynnat 74'minutes
- 16ErhahonSubstituted forMainat 56'minutes
- 44MillarSubstituted forMcAllisterat 72'minutes
- 9BrophySubstituted forDennisat 83'minutes
- 22RamsayBooked at 90mins
- 8BrownBooked at 66mins
- 19FergusonBooked at 50mins
- 11HedgesSubstituted forSamuelsat 72'minutes
- 20JenksBooked at 51mins
- 17HayesBooked at 90mins
- 9RamírezSubstituted forEmmanuel-Thomasat 72'minutes
- 44M Longstaff
- William Collum
- Shots on Target
Second Half ends, St. Mirren 3, Aberdeen 2.
Jonny Hayes (Aberdeen) is shown the yellow card for a bad foul.
Jamie McGrath (St. Mirren) wins a free kick on the left wing.
Foul by Jonny Hayes (Aberdeen).
Calvin Ramsay (Aberdeen) is shown the yellow card for a bad foul.
Foul by Calvin Ramsay (Aberdeen).
Curtis Main (St. Mirren) wins a free kick on the left wing.
Foul by Austin Samuels (Aberdeen).
Conor McCarthy (St. Mirren) wins a free kick in the defensive half.
Foul by Connor Ronan (St. Mirren).
David Bates (Aberdeen) wins a free kick in the defensive half.
Attempt missed. Curtis Main (St. Mirren) header from the centre of the box is just a bit too high. Assisted by Jamie McGrath with a cross following a corner.
Corner, St. Mirren. Conceded by Calvin Ramsay.
Attempt missed. Curtis Main (St. Mirren) header from very close range is just a bit too high. Assisted by Connor Ronan with a cross following a corner.
Attempt missed. Curtis Main (St. Mirren) header from the left side of the six yard box misses to the right. Assisted by Scott Tanser with a cross following a corner.
Corner, St. Mirren. Conceded by David Bates.
Foul by David Bates (Aberdeen).
Kristian Dennis (St. Mirren) wins a free kick in the defensive half.
Substitution, St. Mirren. Kristian Dennis replaces Eamonn Brophy because of an injury.