SAN JOSE — When a San Jose police officer who moonlights as security for the 49ers interjected himself into the alleged domestic violence investigation of team defensive lineman Ray McDonald, it did more than just give the appearance of a conflict of interest.

It put the SJPD squarely in the national spotlight and provided a rare glimpse into the shadowy world of close connections between major sports organizations and local law enforcement agencies. It’s common, in fact, for teams to hire local police as an extra layer of security — essentially serving as a protective detail for athletes.

But the case of Sgt. Sean Pritchard, who reportedly has even traveled with the team, underscores how ethical lines can become blurred, calling into question who exactly off-duty cops are supposed to be serving and protecting.

Dennis Luca, a former SJPD lieutenant-turned-attorney and onetime NHL liaison to the Sharks, is blunt about the unspoken agreement when professional sports teams hire sworn officers for security.

“There is that tacit wink and a nod: ‘If something happens, you’re going to be there for us, right?’ ” Luca said. “That doesn’t mean that every officer working a side job is going to do that. But to not recognize every day there is a potential conflict of interest is absolutely foolish.”

He added: “Of course, you’ll never get that admission from anyone in pro sports.”

The 49ers would not give any specifics about their security arrangements.

McDonald reportedly called Pritchard in the early-morning hours of Aug. 31, and the officer, in uniform, already was at the player’s home in the Silver Creek area of San Jose when other cops responded to a 911 call. McDonald, a key contributor to the 49ers’ defensive unit, would be arrested on suspicion of domestic violence after police said his pregnant fiancee showed “visible injuries.”

But Pritchard’s presence, sources say, complicated the SJPD investigation and contributed to why it took a month to reach the prosecutor’s office — a time during which the 49ers’ controversial decision to keep playing McDonald grew into a national fervor. The Santa Clara District Attorney’s Office announced on Oct. 2 that it had received the case and continues to review whether charges should be filed.

Former San Jose Police Chief Chris Moore said that he could not speak specifically to the McDonald case, but he sees no reason for an officer to go to a scene when someone connected to the cop’s second job is involved.

“If it sounds at all like it has the potential for a criminal complaint, you not only tell them to call 911, but as an officer, you also call 911,” Moore said. “Unless it occurs right in front of you, do not become involved. It will just cloud the potential investigation and prosecution.”

Sources also said this week that on the evening prior to the McDonald call, Pritchard visited the home where the player was throwing his birthday party with teammates. That close relationship is why some on the force are upset about the perception of preferential treatment by police in exchange for rubbing elbows with sports stars on glamorous side jobs.

“These assignments never should have been authorized,” said one veteran officer on condition of anonymity out of fear of reprisal from the department.

Andy Dolich, a longtime Bay Areas sports executive who has worked with the 49ers, A’s and Warriors, said most teams have off-duty law enforcement working for them, and that in his experience, it is a positive arrangement.

“The important thing is you want everyone to act professionally and just do their jobs,” Dolich said. “You emphasize that any crossing of the line is unacceptable. Not knowing the circumstances in this case, it does seems like SJPD might be rethinking its policies and making sure that officers are using the best judgment possible.”

Last week, Pritchard, who is assigned to the gang-suppression unit, was prohibited from working for the team pending an Internal Affairs investigation. Then on Friday, the department issued a blanket suspension of all officers doing off-duty work with the 49ers “until further notice.”

In total, there had been 17 officers moonlighting for the 49ers through a third-party security contractor.

But those moves were not swift enough for many inside the department, who have been grumbling privately about the damage the situation has inflicted on the force’s reputation.

Just as San Jose officers have begun working after-hours for the team, the 49ers have become the NFL’s bad boys. The team leads the league in recent arrests with 10 since the beginning of 2012. Several of those have occurred in San Jose, including cases involving Aldon Smith and Chris Culliver.

SJPD hardly is unique when it comes to law-enforcement agencies wrestling with ethical concerns about secondary employment. But this was the sort of potential conflict that a 2012 city audit explicitly warned could happen because there wasn’t enough oversight governing the after-hours work performed by officers.

And the McDonald case isn’t the first time pro athletes in San Jose have turned to a police officer working for a team for help. In 2004, former Los Gatos detective Randy Bishop, who moonlighted as a security consultant for the Sharks, was convicted and Judge William Danser was disbarred after a conspiracy to dismiss traffic and parking tickets for players and friends.

Dan Durbin, director of the USC Annenberg Institute of Sports, Media and Society, said it’s wise to have a police presence at sporting events. He notes that the lack of security has been cited as a factor in the infamous beating of Giants fan Bryan Stow outside of Dodger Stadium in 2011.

But off-duty cops serving as what amounts to bodyguards leaves the potential for too-cozy relationships to develop, he added.

“McDonald obviously felt this was a safety net,” Durbin said. “If you have a cop coming to your house, it’s a lot nicer if it’s a cop you know. So who is going to blame McDonald for doing that? But it really puts the cop in a challenging position because now his objectivity is in question.”

Sports leagues have created sophisticated security operations — often populated with former high-ranking federal law enforcement officials. Each team, including the 49ers, hires its own security staff.

“But leagues don’t have the breadth or ability to know everything in all cities, so they work through the teams with local police departments,” Dolich said. “Knowledge really is power, and you want to work to protect your athletes and your fans.”

When Dolich ran the business operations of the NBA’s Memphis Grizzlies, the team employed local police.

“Officers might travel with the team so that the players are protected from all manner of threats, like from known gamblers or stalkers,” he said.

Leigh Steinberg, who has been one of the NFL’s most prominent player agents over the past four decades, said he too has hired off-duty officers to serve as “companions” of his clients when they are out in public.

“High-profile athletes always have people coming at them,” Steinberg said. “Police understand crowd control, sense pending danger and know how to prevent worse things from happening. It’s just smart. If I owned a team, I would have a good group of them around.”

Michael Gilleran, the executive director of the Santa Clara University Institute of Sports, Law and Ethics, said it’s not necessarily a bad thing for sports teams to cultivate relationships with law enforcement.

“There’s nothing wrong with them saying, ‘We’d like a head’s up if our guys are hanging out with bad actors,’ ” Gilleran said. “That’s fine. That’s constructive because nobody wants trouble in their community.”

But Gilleran also is a former NCAA investigator who saw how “cooperation” turned into something more nefarious as police — often in small university-towns — actively would help athletic departments cover up missteps by athletes.

“The local chief might call the school and say, ‘Hey, Joe Bob is causing a ruckus. We’ll be there in 20 minutes, so you better get down there in 10 minutes,'” Gilleran said.

Luca contends that the risk of conflict is inherent for police officers, off-duty or otherwise, and that it boils down to each officer’s moral fiber.

“This mistake is a judgment mistake by an officer who forgot his primary job is as a police officer,” he said. “It’s about whether or not you recognize your ethical and moral duty and whether or not you can follow the damn rules.”

Contact Robert Salonga at rsalonga@mercurynews.com. Contact Mark Emmons at memmons@mercurynews.com.