Villa had needed at least a point to stay up and looked like they had made sure of safety when captain Jack Grealish scored with just six minutes left.
The celebrations, though, were cut short as the Irons – who had already guaranteed their own survival – went up the other end to equalise through Andriy Yarmolenko.
There was no more late drama as Villa did enough to retain their top-flight status, having come up via the play-offs last season.
Bournemouth went down despite a 3-1 win at Everton.
Eddie Howe's side took the lead in the 13th minute through a penalty from Joshua King after handball from Richarlison at a free-kick.
Everton equalised on 41 minutes when Moise Kean – handed his first start since January 21 – slotted home a cross from Theo Walcott.
Bournemouth got themselves back in front just before half-time when Dominic Solanke headed in.
Substitute Junior Stanislas made it 3-1 with 10 minutes left, but it was not enough to save the Cherries from a return to the Championship.
Watford's relegation was also confirmed following a 3-2 defeat at Arsenal.
The Hornets – who sacked manager Nigel Pearson with just two games left – were thrashed 4-0 at Manchester City on Tuesday, and found themselves a goal down within five minutes.
Craig Dawson clattered into Alexandre Lacazette, with a penalty given after a lengthy VAR review which Pierre-Emerick Aubameyang converted.
Kieran Tierney grabbed his first goal for Arsenal when the former Celtic defender's shot deflected in off Will Hughes on 24 minutes and Aubameyang hooked in a third for the Gunners 10 minutes later.
Watford, with Hayden Mullins in caretaker charge, gave themselves some hope when Troy Deeney converted a penalty just before half-time after David Luiz had tripped former Gunners' forward Danny Welbeck.
On 66 minutes, the striker grabbed another against his former club, tucking home a low cross from Ismaila Sarr, but there was to be no great escape for the Hornets.
Manchester United made sure of third place as they won 2-0 at Leicester, both goals coming in the second half.
United finally broke the deadlock on 71 minutes when Bruno Fernandes scored a penalty after Anthony Martial had been bundled over.
Jamie Vardy saw his flicked header clip the outside of the post, and after Jonny Evans had been sent off for a foul on Scott McTominay, United made it 2-0 when Jesse Lingard capitalised on a mistake from Foxes goalkeeper Kasper Schmeichel.
Chelsea warmed up for next week's FA Cup final against Arsenal with a 2-0 home win over Wolves, who had themselves been chasing European qualification.
Blues boss Frank Lampard had dropped goalkeeper Kepa Arrizabalaga, and saw his side take the lead at the end of the first half through a fine free-kick from Mason Mount.
The midfielder then set up Olivier Giroud to take the ball around the goalkeeper and slot in a swift second before the break.
Champions Liverpool ended their campaign with a 3-1 win at Newcastle.
The home side got off to a dream start after Dwight Gayle scored after 24 seconds following a quick free-kick.
Virgil Van Dijk, though, drew the champions level seven minutes before the break with a looping header.
The champions completed the turnaround just before the hour when Divock Origi slotted in a 20-yard strike and Sadio Mane added a late third.
Manchester City thrashed relegated Norwich 5-0, with David Silva captaining the side on his final Premier League experience.
The Canaries, who had pulled off a remarkable win over the then-champions at Carrow Road during September, thought they had taken an early lead through Onel Hernandez's long-range effort – but the goal was ruled out by VAR for offside.
City then broke to go in front on 11 minutes when Gabriel Jesus tucked home from close range. Kevin De Bruyne added a second as half-time approached when he curled the ball into the top corner.
With 10 minutes left, Raheem Sterling scored City's 100th Premier League goal when slotting in De Bruyne's pass, which was the Belgian's 20th assist.
Riyad Mahrez and De Bruyne added two more late on to end a sorry campaign for Daniel Farke's men.
Tottenham drew 1-1 at Crystal Palace, where England captain Harry Kane had put them ahead after 13 minutes.
Palace – who had lost seven straight matches since the restart – levelled just after the break when Jeffrey Schlupp fired home from a corner.
Brighton won 2-1 at Burnley.
Yves Bissouma broke the deadlock to give the Seagulls the lead after 20 minutes, but New Zealand forward Chris Wood drew the Clarets level a minute before half-time.
Brighton were back in front five minutes after the restart as Aaron Connolly curled in a low effort past Nick Pope.
Jay Rodriguez thought he had equalised when heading in following a corner, but the goal was ruled out by VAR for offside.
The Blades went ahead after 26 minutes when John Lundstram turned the ball in at the far post.
Adams equalised for Southampton on 51 minutes after latching on a through ball and then knocked home a rebound to put the home side ahead with 19 minutes left.
Danny Ings added a late third from the penalty spot, taking his Premier League tally to 22 goals, just one shy of the Golden Boot which was won by Vardy.