A Santa Monica police officer was attacked inside a convenience store by a man who just got out of prison for an altercation with the same cop just a few months earlier, police said.

The incident was caught on surveillance video at the 7-Eleven on the corner of 16th Street and Santa Monica Boulevard.

In the video, the officer is seen walking to the back of the store to get a drink, when another man appears to confront him. They exchange words, then begin pushing and fighting, moving around the store. The altercation lasted for about two minutes before the officer is able to pull his gun.

Another officer arrives and helps subdue the suspect.

Police identified the suspect as Darryl McIntosh, 28. They say he was recently released from prison after serving five months of a 16-month sentence. It turns out he was arrested for an altercation with the same officer in May.

"The officer was involved in an arrest involving this suspect back in May of 2016," said Lt. Saul Rodriguez of the Santa Monica Police Department. "He was part of that arrest team."

The officer suffered minor injuries and was back to work a few days after the incident.