Gregory Bowyer says he did it in self-defense. A man with a gun was coming at him in a Maryland strip mall parking lot, according to Bowyer’s attorneys, so he pointed his SUV at the man and hit the gas to protect himself and his daughter.

But the family of the man killed, Nathaniel McKinnon, said Bowyer acted out of revenge. Bowyer was upset because ­McKinnon was part of a group that had fired the gun at Bowyer’s daughter during a dispute the night before, and the tensions stretched out into the morning’s deadly collision, prosecutors said.

Almost two years after the fatal encounter, a Prince George’s County jury agreed with prosecutors, finding Bowyer guilty of second-degree murder.

The verdict Thursday capped off a complicated case in which both sides agreed Bowyer fatally struck McKinnon but disagreed over whether a crime was committed.

The jury convicted Bowyer, a D.C. firefighter, on the most serious charge before them. They also considered varying manslaughter charges, which carry lesser sentences.

During trial, both sides sparred over what role an AK-47 later found at the scene played in the incident and whether Bowyer’s actions were reasonable given the weapon’s location.

“McKinnon approached the Bowyers with a loaded AK-47,” Bowyer’s attorney Glenn Ivey said in court. “They were clearly in danger.”

Prosecutors said that the weapon was never aimed at Bowyer and that it was not in McKinnon’s hands at the moment of the ramming.

Instead, Bowyer “was pursuing a reckoning,” prosecutor Kelly McGann said. “He was pursuing a revenge.”

The case stems from an incident Feb. 12, 2017, when Bowyer’s daughter was involved in an altercation with her ex-boyfriend and a gun was fired during the encounter. Bowyer’s ex-boyfriend was arrested and charged with assault. McKinnon, who was also at the scene, was not charged, prosecutors said.

Nine hours after the reported assault, Bowyer drove himself and his daughter back to the scene of the shooting the morning of Feb. 13. He parked his red Range Rover in front of the home and after about five or 10 minutes, McKinnon and his mother came out and drove off.

Bowyer followed the blue Range Rover that McKinnon and his mother piled into, tailing them for more than six miles to the Amish market in Upper Marlboro, Md.

Video played for the jury showed that McKinnon exited his vehicle and walked toward Bowyer’s SUV, which then plowed McKinnon to the ground. Witnesses said they smelled tires burning as Bowyer accelerated. One witness testified that Bowyer said, “I told that son of a bitch to leave my daughter alone,” after McKinnon was down.

“He pressed down on the gas,” because “the opportunity for reckoning presented itself,” said McGann, an assistant state’s ­attorney for Montgomery County.

Montgomery County prosecutors handled the case because relatives of both the defendant and the victim had made campaign contributions to Prince George’s County State’s Attorney Angela Alsobrooks, said John Erzen, a spokesman for Alsobrooks. Erzen said the office would have handled the case fairly but “we understand public perception and we didn’t want anyone to think that any decision was based on anything other than applying the law to the facts.”

Ivey said Bowyer acted to protect himself and his daughter. Bowyer spotted a rifle poking out from McKinnon’s pants, and it was the same weapon Bowyer’s daughter said she was threatened with the night before.

“McKinnon was too close,” Ivey said. “The gun was too powerful. He didn’t really have a choice.”

The AK-47 was loaded with a 30-round clip with a round already in the chamber, according to testimony.

Bowyer went back to the scene of his daughter’s alleged assault to leave a business card for a police officer in the neighborhood who helped them that evening, his daughter testified. When McKinnon and his mother came out that morning, Bowyer called police to relay information about the car and license plate to help authorities, Ivey said.

“If you’re really planning on killing somebody, do you tell the police where you’re going to go?” Ivey said.

Though McKinnon was found with a rifle on his body after he had been hit, prosecutors said surveillance video showed he never pointed the weapon at Bowyer.

“The weapon has to be used in some kind of way that is presenting some kind of danger to us,” said George Simms III, a Montgomery County assistant state’s attorney who prosecuted the case with McGann.

D.C. fire officials said Bowyer is on leave from the department.

McKinnon’s mother, Sheraina Parks-Jones, testified at Bowyer’s trial, emotionally describing how she watched her son get killed.

Parks-Jones said she is grateful for the verdict.

“This journey has been so terrible for me,” Parks-Jones said. “No mother should have to see their child die.”