Authorities in the Dominican Republic believe a local cab driver knew that the David Ortiz shooting was going to happen, with investigators saying he allegedly drove some of the suspected hit men to the scene — and later confirmed to cops that the slugger was not the intended target, a report says.

Franklin Junior Merán, also known as “Rubirosa,” was identified in court documents Thursday after being arrested in connection to the June 9 assassination attempt, according to the Dominican newspaper Listin Diario.

Public Ministry officials say the 25-year-old was driving one of the vehicles that ferried the suspects accused in the $8,000 murder-for-hire operation. Ortiz, 43, wound up being shot in the back by one of the men, who allegedly confused him for his friend, David Fernández.

Police believe a bad photo of Fernández was ultimately to blame, with investigators attributing the mistaken identity to poor lighting — which caused his pants to look white, just like the ones Ortiz was wearing on the night of the shooting.

According to authorities, Merán was in cahoots with the alleged death squad and had been meeting with them in the days before the incident. Gabriel Alexánder Pérez Vizcaíno, one of the suspected liaisons who helped set up the contract killing, reportedly met with Merán and alleged mastermind Alberto Miguel Rodríguez Mota — who is accused of funding the hit and still at large — on June 2.

Police announced earlier this week that Ortiz was not the intended target after obtaining new evidence, though it wasn’t clear what specifically prompted the change in the case.

Investigators believe Fernández’s cousin Victor Hugo Gomez Vasquez, 43, ordered the hit because he thought Fernández had snitched on him before being arrested in 2011. But Ortiz’s friend has shot down these claims — insisting that he has no enemies.

“I’m just a businessman,” Fernández told a Dominican radio station last week. “I don’t know where these rumors came from, I don’t even have a cat as an enemy.”

Cops have arrested at least 11 people in connection to the Ortiz shooting. The Red Sox legend is recovering at Massachusetts General Hospital in Boston.