By Basil Katz

NEW YORK (Reuters) - The artist who created the "Hope" portrait of Barack Obama that became emblematic of the president's triumphant 2008 campaign was sentenced to community service on Friday after admitting he had lied about which image he used.

Los Angeles-based street artist Shepard Fairey, 42, became a celebrity for creating the red, white and blue image of Obama silhouetted above the word "Hope" on a poster.

Fairey pleaded guilty to one misdemeanor count of criminal contempt in February for doctoring and destroying evidence once he realized the photograph of Obama he used for the poster belonged to the Associated Press.

"I'd like to apologize for violating the court's trust, which was the worst thing I've ever done in my life," Fairey said at his sentencing hearing in Manhattan federal court.

Prosecutors had sought some prison time for Fairey, who faced up to six months in prison on the charge. Fairey was ordered to serve 300 hours of community service, the details of which were not immediately decided.

Although lawyers at Friday's hearing sparred for nearly an hour over what sentence Fairey should receive, the word "Obama" was not uttered a single time.

The conclusion of the case coincided with Obama accepting his Democratic Party's nomination on Thursday night to run for re-election in November.

The dispute over the "Hope" poster began when Fairey pre-emptively sued AP in February 2009 seeking a ruling that his work was protected from AP's potential claims over the copyright of the original photograph of Obama. AP then countersued for copyright infringement.

After it was discovered that some of Fairey's records had been improperly deleted, he admitted that he had intentionally lied about which photograph he had based his poster on.

He was charged because deleting his files and altering them was a violation of an order by the federal judge overseeing the civil dispute with AP. The judge said both parties must share all documents with the other side.

In January last year, AP and Fairey settled their copyright dispute.

The AP said in a statement on Friday that it was "glad this matter is finally behind us."

The photograph that Fairey based his poster on was taken by AP photographer Mannie Garcia at a panel discussion at the National Press Club in April 2006 when Obama was still a U.S. senator from Illinois.

The case is USA v. Shepard Fairey, U.S. District Court for the Southern District of New York, No. 12-cr-180.

(Reporting by Basil Katz; Editing by Paul Thomasch and Will Dunham)