A reporter with Israel's Haaretz newspaper, Uri Blau, was sentenced to four months of community service under a plea bargain for possessing classified military documents, the court said.
"I accept the the plea bargain reached by the parties, and sentence the accused to a single term of four months' jail which may be served by means of community service... starting from 11 September 2012," wrote Judge Ido Druyan at Tel Aviv Magistrates Court on Monday.
He will serve his community service at Reut medical centre in Tel Aviv.
Blau was convicted at Tel Aviv District Court in July of possessing secret army papers that he received from a former soldier who was subsequently jailed on charges of spying.
"This is a very sad day," he told reporters outside the court, in remarks carried by Israeli media.
"The prosecution should not have filed an indictment to begin with."
As part of the plea bargain, which was agreed with the State Prosecutor's Office on July 5, Blau agreed to admit to the charge of possessing secret information without intending to harm state security.
"This is a precedent-setting prosecution of a journalist for doing his job," one of his lawyers, Jack Hen, said at the time, adding that Blau should not have been charged and that all of his reports had been cleared by the military censor.
"According to it, the public's right to know and freedom of the press were seriously damaged by the decision to put a journalist on trial for these reasons," he told Haaretz website.
Court documents showed that former soldier Anat Kam handed some 1,800 documents to Blau who used some of them as the source for an article in 2008 which said troops had been ordered to carry out targeted killings of Palestinian militants in violation of a Supreme Court order.
Blau later handed over all the classified documents in his possession to the security establishment.
Kam was sentenced to four and a half years in jail in October 2011 after pleading guilty to leaking the documents.
She has said her actions were ideologically motivated and that she wanted to expose the army's policies in the occupied Palestinian territories.