But for two minutes of second-half madness Chelsea would have retained their 100 per cent unbeaten record to the season.
Costa opened the scoring on18 minutes when he lashed home from just inside the Swans penalty area.
Then those two minutes saw a complete turnaround as first Gylfi Sigurdsson scored from the penalty spot as Thibaut Courtois hacked the Icelander down following a quick breakaway.
Then Gary Cahill was dispossessed and the ball was taken by Leroy Fer who slotted home.
But the Blues are made of tougher stuff and with the clock ticking down, up stepped Costa to spectacularly produce a cycle kick to smash the ball home to level.
John Terry limped off the pitch at the stroke of the final whistle.
If his injury proves to be serious, it could mean the introduction of David Luiz for Friday’s home clash with Liverpool and signal the end of Terry’s amazing career at Chelsea.
A very aggressive start by the hosts saw Diego Costa, Willian, Gary Cahill and John Terry get flattened in the course of the opening five minutes.
But the first chance on goal came from the right boot of Willian, who forced a fine save from Lukasz Fabianski, who parried the ball away for a comer.
There then followed a period of midfield drudgery before on, 18 minutes my the Blues broke the deadlock.
A failed clearance by the Swans back four allowed Oscar to control the ball, and slide it to in-running Costa, who lashed home a low drive past the outstretched palm of Fabianski.
The Polish goalkeeper was soon again in action, this time thwarting Eden Hazard., who broke clean through before Fabianski threw his body at the ball.
The first yellow card by Andre Marriner went to Leroy Fer who hauled down Costa on 28 minutes.
A flashing drive by Gylfi Sigurdsson from just outside the Chelsea area inched past Thibaut Courtois’s left upright.
Two yellow cards came then in quick succession, one for Costa for a last tackle on Fer, the second by Federico Fernandez.
Costa should have wrapped the game up two minutes from time, but somehow he screwed his close range shot at the far post across goal, rather than tapping the ball into the unmarked net.
There were no changes from with side’s manager’s at half-time, although Swansea had replaced Neil Taylor with Modou barrow on 43 minutes.
It took Marriner just two minutes from then restart to book Jordi Amat for a thundering challenge from behind on Costa which left the Brazil-born Spain striker writhing on the ground.
The Blues should have doubled their lead at least twice, but each time either Fabianski saved or there was a lack of players in position from the killer pass.
Then all hell broke loose on 58 minutes when a quick breakaway by Swansea’s Barrow saw Sigurdsson break through. Courtois misjudged the out swinging nature of the ball and had to run further than he thought towards the edge of his penalty area. He lunged for the ball and the Iceland midfielder hit the deck as Courtois leg came across his leg. Sigurdsson dispatched the penalty with ease. The two minutes later, the Blues were behind. Gary Cahill was caught in possession by Leroy Fer who raced clear and while Courtois got a touch to it, the ball spun over him and into man the nest despite the best effort of Cahill to hack it away from goal.
Oscar forced a great save from Fabianski on 66 minutes, the goalkeeper tipping away a high curler when it was edging towards the top corner of his net.
Chelsea head coach Antonio Conte had seen enough self-destruction and brought on Cesc Fabregas and Victor Moses for Nemanja Matic and Willian.The Blues almost levelled on 80 minutes but his header went over Fabianski’s crossbar.
But the deserved equaliser came on 83 minutes when force pressure on the Swans goal saw a hazard shot lobbed into the air six yards from goal and Costa acrobatically produced an overhead kick to smash the ball home.
Michy Batshuayi came on with two minutes to go for Oscar but immediately hazard was yellow carded for a foul on a quick Swansea breakaway.
Despite Swansea finishing stronger the Blues held onto the well deserved point, but will rue the missed chances.
Teams: Chelsea, Courtois, Ivanovic, Kante, Oscar, Hazard, Costa, Matic, Willian, Cahill, Terry, Azpilicueta.
Begovic, Alonso, Fabregas, Pedro, Moses, Batshuayi, Luiz
Fabianski, Amat, Taylor, Subg-Yung, Fer, Llorente, Sigurdsson, Cork, Naughton, Fernandez, Kingsley.
Nordfeldt, Van dear Hoorn, Britton, Barrow, Montero, Rangel, Fulton.