The former television producer who tried to blackmail David Letterman was freed Thursday after four months in jail for a plot that put a spotlight on the comic icon's office affairs, city Correction Department records show.

Robert "Joe" Halderman got time off for good behavior from his six-month term at the Rikers Island jail complex, but he isn't done with his sentence: He still has to complete 1,000 hours of community service, and he'll be on probation for five years.

"He survived this, and he's glad to be getting off the island," said his lawyer, Gerald Shargel. The former CBS "48 Hours" producer - who's up for a News and Documentary Emmy award this year - is looking for work, Shargel added.

Halderman, 52, pleaded guilty earlier this spring to attempted grand larceny. He admitted he demanded $2 million in hush money last fall to keep from revealing personal information about Letterman, presenting his threat in a somewhat colorful form: as an outline for a thinly veiled screenplay about the "Late Show" host being ruined by disclosures about his personal life.

The case spurred Letterman, who had married his longtime girlfriend about six months before, to reveal on-air that he'd had sex with women on his show's staff.

Halderman's scheme was fueled by both financial problems and romantic jealousy, his lawyer has said. Halderman had peeked in his former girlfriend's diary and read her account of a relationship with Letterman, her boss - information he used to bolster his threat to make the comic icon's world "collapse around him," authorities said.

Halderman, who was divorced at the time, remarried before going to jail in May, Shargel said. And while he no longer has his job at CBS' "48 Hours," he has been nominated for an Emmy for an April 2009 story about an American exchange student charged with murder in Italy. He was one of four producers cited for the story. The news Emmys will be presented Sept. 27 in New York.

CBS, also home to Letterman's show, has declined to discuss whether Halderman resigned or was fired.

While behind bars, Halderman worked in a jail library program, among other assignments. His community service will entail providing job training to people who had been homeless and convicts getting out of prison.

While Letterman's popularity emerged unscathed from the scandal, the host has said it was an emotional blow. He and his wife, Regina Lasko, began dating in 1986 and have a 6-year-old son.

"You take a look at the explosion, and it knocks you down, and you wake up every morning, and you're scared and you're depressed and sad," he said on "Live! With Regis and Kelly" in April.

"And you kind of got to let that knock you down and knock you down, and then pretty soon you've got to start knocking IT down. And then, when that happens, you start looking at the pieces left of your life."

A spokesman for Letterman declined to comment on Halderman's release.