NEW YORK – The artist who created the “HOPE” poster that came to symbolize Barack Obama’s 2008 presidential campaign was ordered to do 300 hours of community service Friday for a criminal contempt conviction but was spared jail time.

Shepard Fairey, 42, of Los Angeles nodded his head several times and said “OK” as U.S. Magistrate Judge Frank Maas told him he must commit no crimes during two years of probation and must pay a $25,000 fine to the U.S. government.

During remarks before the sentence was announced, Fairey called his decision to fabricate evidence in a civil lawsuit he brought against The Associated Press in 2009 the “worst thing I’ve done in my life.” He also apologized.

“I am deeply ashamed and remorseful that I didn’t live up to my own standards of honesty and integrity,” he said. After the sentencing, Fairey hugged his lawyers, was kissed by his wife, and shook hands with more than a dozen friends who packed into the small Manhattan courtroom.

Maas said the sentence needed to send a message to others who might destroy or fabricate evidence in a civil case that the consequences of covering up what they did is far worse than telling the truth.

But he said Fairey’s considerable charity work over a long period of time mitigated the need for prison on a misdemeanor charge that carried a maximum potential sentence of six months.

“Punishment has been and will be in the form of public disgrace,” Maas said.

The sentence was announced after Assistant U.S. Attorney Daniel W. Levy warned that no loss of liberty for Fairey would send “a terrible message” to others who might tamper with evidence.

He said the crime had caused the AP “massive financial consequences,” and he noted that Fairey personally paid only $1.15 million of the $1.6 million owed to the AP in the settlement of the civil case. Insurance covered the rest.