Samsung has gone one selfie too far with its viral marketing, earning a rebuke from the White House after it distributed a photo of President Obama and Boston Red Sox star David Ortiz.

The selfie was taken during a visit to the White House this week by the 2013 World Series winners. Ortiz, who has an endorsement deal with Samsung, put the photo on Twitter, and the electronics company re-tweeted the post to its 5.2 million followers.

But turning the event into a promotional exercise for Samsung was apparently not on the White House's agenda.

"I can say that as a rule, the White House objects to attempts to use the president's likeness for commercial purposes," White House press secretary Jay Carney said Thursday. "And we certainly object in this case."

Carney declined to say whether White House lawyers were in contact with Samsung, saying that he would not comment on "counsel's discussions."

Related: Obama's economy in 17 charts

Samsung (SSNLF) did not immediately respond to a request for comment. But the company said in a statement to the Boston Globe on Tuesday that it was "thrilled to see the special, historic moment David Ortiz captured with his Galaxy Note 3."

"When we heard about the visit to the White House, we worked with David and the team on how to share images with fans. We didn't know if or what he would be able to capture using his Note 3 device."

Related: Samsung's Oscar ads? $20 million. Ellen's selfie? Priceless

At the time, the selfie appeared to be an unscripted moment -- and one the president clearly enjoyed.

"Alright come on, let's get a good picture here," Obama told Ortiz after the slugger presented him with a Red Sox jersey .

"Actually, do you mind if I take my own?" Ortiz countered.

"Oh, he wants to do a selfie," Obama said, drawing laughter from the crowd. "It's the Big Papi selfie."

Asked about the episode, Ortiz said the selfie was spontaneous.

"I wasn't trying to do anything," Ortiz told the Boston Globe. "It just happened in that moment. It was a fun thing. I signed that deal with Samsung a few months ago. They didn't know what would happen. Nobody did."

While the administration is clearly keen to protect Obama's image, it's not clear whether the White House would have any legal basis for a complaint. Obama's likeness has been used in a variety of commercial ventures since he was first elected, including an unauthorized Times Square billboard that featured the president wearing a Weatherproof Garment Company coat.

The White House claimed that ad was misleading because it implied the president had endorsed the coat company. A legal defense against that argument would likely have relied on the First Amendment.

Samsung has previously used celebrity selfies to market its products, including one featuring Ellen DeGeneres taken at the Oscars.

"I thought it was a pretty cheap stunt myself," Obama later joked during an appearance on Ellen's show, "Getting a bunch of celebrities in the background, feeding them pizza."