Frank Lampard scored twice to become Chelsea's all-time leading scorer as the Blues came from behind to win at relegation-threatened Aston Villa.
Christian Benteke put Villa ahead with a strong run and finish, while Chelsea had Ramires sent off before half-time.
After the break Benteke saw a red card and Lampard fired his side level.
The midfielder then collected his 203rd Blues goal to break Bobby Tambling's record and all but secure their place in next season's Champions League.
Lampard has scored 13 Premier League goals against Aston Villa, his most against any single opponent
Chelsea sit third in the table with one game left and only an unlikely mathematical scenario can deny them a top-four place.
Arsenal could end up above them and Tottenham can finish on the same points, but Chelsea's goal difference is 17 better than that of Spurs.
Although the result leaves Villa five points clear of the relegation zone in 13th, they have played a game more than every team beneath them.
Paul Lambert's side will feel hard done by, but Lampard's intervention sums up the impact he has made throughout his career as he exploited a defence that has now gone 21 league games without a clean sheet.
For so long it seemed Villa were heading for a sixth win nine matches to secure survival, their newfound confidence clear for all to see.
They were thrashed 8-0 in December's reverse fixture at Stamford Bridge, but there was no sign of scars from that humbling as a youthful and well-organised line-up attacked with pace and power.
Benteke opened the scoring when he met Brad Guzan's long ball forward with a touch to Yacouba Sylla, took the return pass, ghosted past Gary Cahill and planted an assured finish past Petr Cech at the near post.
It was the Belgian's 19th goal of an impressive debut Premier League season and his 23rd in all competitions.
Villa Park was rocking and the noise level rose again when Fabian Delph rifled narrowly off target before, in the 19th minute, applause rang out for newly retired captain Stiliyan Petrov, who has been forced to quit the game as he continues his battle with leukaemia.
Chelsea worked hard to restore parity - Guzan denied Demba Ba when one-on-one and pushed Lampard's free-kick on to a post - but Villa held firm and their prospects improved when the visitors had Ramires sent off.
The Brazilian had already been cautioned for a challenge on Benteke when he caught Gabriel Agbonlahor with a high foot.
That saw the momentum swing towards Villa and they dominated the start of the second half, with an Agbonlahor-led counter-attack setting the tone before both he and Joe Bennett went close to doubling the lead.
But the hosts' progress faltered as Benteke, booked for catching Cesar Azpilicueta with his elbow in the first half, was shown a second yellow card for a high foot that connected with John Terry.
Two minutes later, Eden Hazard found Lampard and he produced a fizzing left-foot finish that left Guzan with no chance.
Chelsea pressed for the winner and Cahill's strike was stopped on the line by Sylla, and although TV replays showed Ba's follow up may have crossed the line it was not given and Ashley Westwood cleared.
Terry - and later Hazard - went off injured, a worry for Rafael Benitez ahead of Wednesday's Europa League final.
But the Blues were left celebrating after Lampard rounded off a brilliant late move with the goal that rewrites the record books.
Aston Villa manager Paul Lambert: "We should have won the game. I thought we looked great and played good football, we had a good tempo. Some of the decisions today were bizarre. The referee missed the John Terry one, he's taken down Yacouba Sylla. You've got to be big enough to make that decision.
"We were so far in control of that game. We didn't deserve that - we were excellent.
"I thought we should have had a penalty. There were so many decisions that were poor."
Chelsea manager Rafael Benitez: "It [all but qualifying for the Champions League] was a great achievement. With a lot of games we have played, it was difficult but we did well.
"It was a dramatic game. The sending-off for us was a big problem. We had to change our game plan at 11 v 10. When Christian Benteke was sent off it made a difference.
"We have to wait and see how the injured players are. John Terry has twisted his ankle and we have to wait for a scan. Hazard hurt his hamstring and we will have to wait and see."
- 22 Guzan
- 04 Vlaar
- 27 Bennett
- 30 Lichaj
- 32 Baker Booked
- 15 Westwood
- 16 Delph
- 18 Sylla
- 11 Agbonlahor
- 20 Benteke Dismissed after an earlier booking
- 26 Weimann
- 01 Given
- 37 Williams
- 10 N'Zogbia
- 14 Holman
- 38 Gardner
- 09 Bent
- 21 Bowery
- 01 Cech
- 03 Cole
- 24 Cahill
- 26 Terry Booked (Ivanovic - 75' )
- 28 Azpilicueta
- 07 Ramires Dismissed after an earlier booking
- 08 Lampard Booked
- 10 Mata
- 13 Moses (Luiz - 46' )
- 17 Hazard
- 29 Ba (Torres - 88' )
- 22 Turnbull
- 02 Ivanovic
- 04 Luiz
- 11 Oscar
- 30 Benayoun
- 57 Ake
- 09 Torres
Live Text Commentary
Full Time The referee brings the game to a close.90:00 +6:51
Centre by Joe Bennett, Branislav Ivanovic makes a clearance. Outswinging corner taken right-footed by Ashley Westwood from the right by-line, clearance by Cesar Azpilicueta.90:00 +5:55
Outswinging corner taken from the right by-line by Ashley Westwood.90:00 +5:38
Shot by Yacouba Sylla from 20 yards. Branislav Ivanovic gets a block in.90:00 +1:47
Outswinging corner taken left-footed by Juan Mata played to the near post. Unfair challenge on Fernando Torres by Eric Lichaj results in a free kick. Free kick taken by Juan Mata. David Luiz takes a long range shot clearing the crossbar.87:52
Eden Hazard provided the assist for the goal.87:52 Goal scored
Goal! - Frank Lampard - A Villa 1 - 2 Chelsea A goal is scored by Frank Lampard from inside the six-yard box low into the middle of the goal. Aston Villa 1-2 Chelsea.86:37 Substitution
Substitution Demba Ba leaves the field to be replaced by Fernando Torres.86:37
Shot from 20 yards from Ashley Westwood. Save by Petr Cech. Andreas Weimann is flagged offside by the assistant referee. Petr Cech takes the indirect free kick.85:04
Frank Lampard takes a shot. Bradley Guzan makes a comfortable save.84:39
Joe Bennett takes a deflected shot. Gary Cahill gets a block in.84:12
Free kick taken by Ashley Westwood.84:12 Booking
Booking Frank Lampard receives a yellow card for unsporting behaviour.83:45
Andreas Weimann fouled by Frank Lampard, the ref awards a free kick.83:09
Corner taken by Juan Mata, Nathan Baker manages to make a clearance.82:59
The ball is sent over by Cesar Azpilicueta.81:21
Eric Lichaj challenges Eden Hazard unfairly and gives away a free kick. Shot on goal comes in from David Luiz from the free kick, save made by Bradley Guzan.79:01
Eden Hazard fouled by Ashley Westwood, the ref awards a free kick. Juan Mata shoots direct from the free kick.78:27
The assistant referee signals for offside against Joe Bennett. Petr Cech takes the indirect free kick.77:30
Centre by Cesar Azpilicueta, Frank Lampard produces a header from inside the area that goes over the crossbar.
Substitution Branislav Ivanovic is brought on as a substitute for John Terry.72:20
Outswinging corner taken by Juan Mata.71:22
Juan Mata delivers the ball, blocked by Eric Lichaj. Corner from the left by-line taken by Juan Mata, Gary Cahill takes a shot. Clearance made by Andreas Weimann.67:51
Fabian Delph has an effort from just inside the box that misses to the left of the target.66:19
Ashley Westwood takes a outswinging corner.65:00
A cross is delivered by Andreas Weimann, Petr Cech makes a comfortable save.60:18
The assist for the goal came from Eden Hazard.60:18 Goal scored
Goal! - Frank Lampard - A Villa 1 - 1 Chelsea Goal scored by Frank Lampard from just outside the area to the top left corner of the goal. Aston Villa 1-1 Chelsea.57:43
Direct free kick taken by Petr Cech.57:43 Dismissal
Dismissal Red card for Christian Benteke.57:37
Foul by Christian Benteke on John Terry, free kick awarded.55:16
Shot from outside the penalty box by Fabian Delph goes wide right of the goal.54:22
Joe Bennett takes a shot. Blocked by Cesar Azpilicueta. Corner taken right-footed by Ashley Westwood.52:49
Yacouba Sylla concedes a free kick for a foul on David Luiz. David Luiz takes the direct free kick.51:45
Effort from the edge of the box by Gabriel Agbonlahor goes wide of the left-hand post.51:11
Yacouba Sylla takes a shot from just inside the penalty box which clears the bar.49:41
Unfair challenge on David Luiz by Fabian Delph results in a free kick. Gary Cahill restarts play with the free kick.49:06
Demba Ba is flagged offside by the assistant referee. Free kick taken by Bradley Guzan.46:43
Andreas Weimann is ruled offside. Indirect free kick taken by Cesar Azpilicueta.46:02
Gabriel Agbonlahor takes a shot. Gary Cahill gets a block in.45:01
The second half kicks off.45:01 Substitution
Substitution David Luiz on for Victor Moses.45:00 +2:25 Half time
Half Time The first half comes to an end.45:00 +1:53
Gabriel Agbonlahor takes a shot. Blocked by Gary Cahill.45:00 +0:57
Andreas Weimann fouled by John Terry, the ref awards a free kick. Eric Lichaj takes the free kick.44:20
Free kick taken by Bradley Guzan.44:20 Dismissal
Dismissal Nascimento Ramires is sent off by the referee.44:13
Free kick awarded for a foul by Nascimento Ramires on Gabriel Agbonlahor.42:59
Foul by Gabriel Agbonlahor on Gary Cahill, free kick awarded. Petr Cech restarts play with the free kick.41:32
Ashley Westwood restarts play with the free kick.41:32 Booking
Booking John Terry receives a caution for unsporting behaviour.41:24
Foul by John Terry on Yacouba Sylla, free kick awarded.40:27
Unfair challenge on Gary Cahill by Christian Benteke results in a free kick. Free kick taken by Petr Cech.39:42
Centre by Andreas Weimann, clearance by John Terry. Ashley Westwood takes a outswinging corner.38:05
Outswinging corner taken by Juan Mata from the left by-line played to the near post, Yacouba Sylla makes a clearance.37:03
Gary Cahill challenges Gabriel Agbonlahor unfairly and gives away a free kick. Free kick crossed right-footed by Ashley Westwood, clearance by Ashley Cole.36:29
Shot by Frank Lampard. Blocked by Nathan Baker.35:50
Petr Cech restarts play with the free kick.35:50 Booking
Booking Caution for Christian Benteke.35:08
Cesar Azpilicueta fouled by Christian Benteke, the ref awards a free kick.34:35
Free kick awarded for an unfair challenge on Gabriel Agbonlahor by Nascimento Ramires. Bradley Guzan takes the free kick.32:35
Free kick awarded for a foul by Demba Ba on Andreas Weimann. Bradley Guzan takes the direct free kick.30:22
The ball is crossed by Juan Mata, Ashley Westwood manages to make a clearance.29:56
Corner taken right-footed by Eden Hazard.28:40
Free kick awarded for a foul by Gabriel Agbonlahor on Eden Hazard. Frank Lampard produces a shot on goal direct from the free kick, save by Bradley Guzan.27:06
The ball is crossed by Joe Bennett, clearance by Gary Cahill. Inswinging corner taken by Ashley Westwood, Petr Cech makes a comfortable save.23:57
Juan Mata takes a inswinging corner from the right by-line to the near post, Nathan Baker makes a clearance.23:16
Cesar Azpilicueta fouled by Andreas Weimann, the ref awards a free kick. Juan Mata crosses the ball from the free kick left-footed from right wing, Fabian Delph manages to make a clearance.22:24
Demba Ba takes a shot. Save made by Bradley Guzan.21:01
The assistant referee flags for offside against Gabriel Agbonlahor. Gary Cahill restarts play with the free kick.19:19
Eden Hazard delivers the ball, clearance made by Ron Vlaar.18:33
Fabian Delph concedes a free kick for a foul on Nascimento Ramires. Juan Mata crosses the ball in from the free kick, Nathan Baker makes a clearance.16:37
Effort from outside the penalty box by Fabian Delph goes wide left of the goal.15:44
Free kick taken by Joe Bennett.15:44 Booking
Booking Nascimento Ramires goes into the referee's book.15:40
Unfair challenge on Christian Benteke by Nascimento Ramires results in a free kick.14:00
Assist by Yacouba Sylla.14:00 Goal scored
Goal! - Christian Benteke - A Villa 1 - 0 Chelsea Christian Benteke scores a goal from close range to the bottom left corner of the goal. Aston Villa 1-0 Chelsea.6:41
Victor Moses is ruled offside. Bradley Guzan takes the indirect free kick.4:59
The ball is crossed by Ashley Cole, Ron Vlaar makes a clearance.3:34
Direct free kick taken by Gary Cahill.3:34 Booking
Booking Nathan Baker is shown a yellow card for unsporting behaviour.3:26
Unfair challenge on Juan Mata by Nathan Baker results in a free kick.0:00
The referee gets the game underway.
Live data and text provided by our data suppliers