Stokes is standing trial at Bristol Crown Court accused of knocking out two other men outside a nightclub in the southwest English city in September past year.
Mark Spure, off-duty police community support officer (PCSO), gave evidence on Wednesday and said he saw a group of people involved in a "scuffle" as he left Mbargo nightclub in the Clifton area of Bristol.
In statements provided to the police in the aftermath of the incident and read to the court on the third day of the trial - the first time since the incident that Stokes' version of events has been made public - he also claimed that two men (Kai Barry and William O'Connor), who he claims had been subjected to "nasty homophobic abuse" from Ali and Hale, thanked him for protecting them.
"I decided at this point matters had become too serious to ignore and that I had to intervene to stop Ryan Ali", Stokes told police.
The jury heard he then identified Mr Stokes to police officers, who arrested the cricketer.
Images released today show the injuries sustained by Ali and Hale after allegedly being attacked by Stokes, hours after England beat the West Indies in a one-day global in the city.
The court has heard it was Stokes who had struck Ryan Ali, knocking him to the floor.
Stokes, of Durham, Ali and Hale, both of Bristol, deny affray.More news: Trump claims tariffs are 'working big time'
"It was homophobic in nature. One of them said something like "shut the f**k up or I'll bottle you". I took exception and said "leave it out" and "you shouldn't be taking the piss because they're gay".
"So, I felt the need to defend myself".
"As the group came to my attention, I heard some of what was being said", Stokes said in the written statement.
The doorman said Hales asked what had happened and, after being told, said to his team-mate: "Stokesy - don't do that".
Stokes replied: "Because he was abusing my two friends for being gay".
"I grappled with the second guy, in the course of that I can recall hitting him a couple of times".
Stokes then tried to shake hands with Cunningham, but this was refused, which Corsellis said "seemed to enrage Mr Stokes".
Ben Stokes pictured outside Bristol Crown Court.