Warning: Graphic language

The man in the 8-ball jacket ​seen slapping a belligerent woman on the F train ​in an online video that went viral ​had all charges against him dropped Monday afternoon after authorities ​determined he was acting in self-defense, his lawyer told The Post.

Jorge Pena spent four nights in jail after the brawl, which ​was widely viewed after footage was posted ​to YouTube, before making his $1,000 bail early Tuesday.

A law enforcement source confirmed that all the charges against Pena were dismissed.

Pena’s lawyer, Cary London, said he thinks the charges were thrown out because the woman in the video appeared to be the aggressor.

“This time the system worked,” London said.

“Thank God for smartphones because the DA’s office was able to have all of the information in front of them at an early stage to show that our client did nothing wrong and acted in self-defense.”

The ​video, which has been viewed more than 3.8 million times​ since it was posted ​Nov. 8, showed authorities that the ​apparently drunk straphanger, Shanique Campbell, poked fun at Pena’s jacket and his slight speech impediment before using her 6-inch stiletto as a weapon — hitting Pena behind the left ear and on his face.

“He’s not an aggressive guy. He’s like Andre the Giant,” Lo​​ndon said of his ​6-foot-6 ​client, who had just finished a 12-hour shift as a bouncer at a Lower East Side bar.

London plans to press charges against Campbell on Pena’s behalf sometime this week.