Authorities in the Dominican Republic believe former Red Sox slugger David Ortiz was shot in a plot involving a cop hired as a hit man, a law enforcement source told The Post on Monday.

“They’re definitely looking at a police officer in the shooting,’’ the source said.

Ortiz, 43, was sitting at an outdoor bar with friends in a trendy neighborhood of the capital, Santo Domingo, Sunday night when he was shot in the back by someone who rode by on a motorcycle. Video of the brazen attack has gone viral online.

Ortiz’s rep, Leo Lopez, said the drive-by on Ortiz, known as “Big Papi,’’ was clearly “an act of hired killers.’’

He told local newspaper Diario Libre that the married father of three didn’t know why he had been shot. Police have said the shooting was not a robbery.

Officials have a suspect in custody — Eddy Feliz Garcia, 25, who has a prior arrest for drug possession in 2017.

But they said they were hunting for more, including the man who was on the back of the Baja Platina motorcycle allegedly driven by Garcia.

Also wounded in the attack were the Boston baseball legend’s friend, TV host Jhoel Lopez, and a third person.

“If we had known that there was a dangerous situation, he would not have been there at that time,” Ortiz’s rep said.

An angry mob was caught on cellphone video later beating and kicking Garcia as he cowered on the ground on a street nearby. The beating sent him to a hospital.

“Some wanted to kill him, but several people prevented that, so he will talk about why he did that,’’ a local worker told local newspaper Listin Diario.

Ortiz was rushed to the hospital in a black Rolls-Royce owned by a wealthy friend, Eliezer Salvador, who was with him at the time.

“Please don’t let me die. I am a good man!” Ortiz begged as he was rushed into the emergency room.

He spent six hours in surgery overnight, with doctors removing his gallbladder and parts of his intestines and colon to stem the bleeding, officials said.

A photo surfaced of him in his hospital bed hooked up to machines, and it spread across Twitter and other social media.

Red Sox president Sam Kennedy said at a press conference in Boston on Monday afternoon that doctors “have confirmed that David’s condition is still serious’’ but that he had been stabilized enough to be flown to a Boston hospital for further treatment.

An air ambulance owned by the team was flying Ortiz to Massachusetts General Hospital hours later.

“David Ortiz is probably the most beloved and one of the most important players in our history,’’ said Kennedy, who got choked up while speaking. “I’d be hard-pressed to think of anyone more beloved than David.’’

Kennedy said he had been texting Ortiz’s wife, Tiffany, who was in the States with their kids, and that “she expressed her gratitude’’ for all the support.

The first thing Ortiz asked about when he regained consciousness was his family, local doctors said.

“He finds himself in a good state of mind and is waiting to travel to Boston … to see his personal doctors and his wife,” said Dr. Jose Abel Gonzalez, one of the surgeons who saved the All-Star’s life.

Police said they had yet to talk to Ortiz because of his condition but plan to.

Ortiz retired in 2016 after helping the Sox win three World Series titles. He was named the series’ MVP in 2013.

While still playing, in 2015, Ortiz, who lives with his wife and kids in Miami, complained about the lack of security in his homeland.

“I like to go to my country, and I know that people love you and take care of you,’’ Ortiz told ESPN, according to Listin Diario.

“But [the street hustlers] are doing their thing, and they are not in their right mind, no matter who is who, and I do not want to walk with an AK-47 over to a car there, I do not want to go full of guns there because I’m not a gunslinger, and I’m not a problem of any kind,” Ortiz said.

He added at the time that he hoped the nation’s head of police would take steps to improve security.

“We cannot live in that anxiety that every time you go out of your house, a [thug] comes and takes away what you have on you,’’ the slugger said. “Many people are losing their lives. Our country is a diamond that we have to take care of and defend fully and hope that things improve.’’

After Sunday’s shooting, well wishes poured in.

Former Red Sox teammate Pedro Martinez tweeted out a photo of himself hugging Big Papi, writing, “I’m at peace knowing you’re out of danger.’’

Jon Lester, another former Red Sox pitcher, wrote that he was in “utter shock’’ at the shooting.

“That was no robbery, that was a hit, and they better get to the bottom of it,’’ he said. “Thank God no amount of evil or hate can overcome a heart that big. You got this David Ortiz, we love you bro!”

Former President Barack Obama, a White Sox fan, tweeted, “Get well soon, Papi,” alongside a photo of him getting a personalized Red Sox shirt from the slugger when the team visited the White House in 2014.

“Six years ago, David Ortiz’s spirit and resolve helped us all begin to heal from the Boston Marathon bombing,” Obama added of the player, who made a rousing speech calling Boston “our f- -king city” after the 2013 terror attack.

“Today, I want to join many others in wishing him a speedy recovery of his own.’’

Former Yankee great Alex Rodriguez tweeted, “Only prayers for @davidortiz, Tiffany and their family.”