Edward Walsh, the former politically powerful Suffolk County Conservative Party leader, was sentenced Tuesday to 2 years in prison following his conviction on federal charges of wire fraud and theft of government services for pocketing hundreds of thousands of dollars from the Suffolk sheriff’s department while golfing, gambling and politicking on county time.

In addition, Walsh — who also worked as a lieutenant in the sheriff’s department — was ordered by U.S. District Court Judge Arthur Spatt at the federal courthouse in Central Islip to make $202,000 in restitution, forfeit an additional $245,000, and serve 3 years supervised release.

Walsh, 51, of East Islip, was convicted of the charges in March 2016 after a 10-day trial by a jury that deliberated for only an hour.

“I humbly accept the verdict of the jury,” Walsh told the judge before sentencing. “I will continue to make the world a better place . . . I will love this great country and everything it stands for.”

Spatt said he hoped the sentence would send a message to other public servants. “ ‘Don’t do this.’ . . . This defendant undermined the trust that is essential to the functioning of our government,” the judge said.

Spatt said Walsh had “cheated and defrauded the citizens of this community.”

advertisement | advertise on newsday

But Spatt added that in determining the proper sentence, he also took into account that Walsh had led “a good and productive life . . . and has helped many people.”

Walsh’s attorneys had asked that he not be sentenced to prison, but instead to home detention and community service. Federal prosecutors had asked for up to 30 months.

In recommending a sentence for Walsh, Eastern District prosecutor Raymond Tierney said he still maintained influence as a number of people connected to the Conservative party had written letters of support to the judge.

Walsh and his attorneys declined to comment on the sentence as they left the courthouse. Federal prosecutors Tierney and Catherine Mirabile also declined to comment.

Walsh is supposed to surrender at the end of August and has requested that he serve his time at the federal prison in Fort Dix, New Jersey. The federal Bureau of Prisons will ultimately decide where he will be imprisoned.

“It’s a fair sentence, considering what he did,” said Suffolk Sheriff Vincent DeMarco, who helped touch off the federal investigation when he went to the U.S. Attorney’s office with the allegations against Walsh. DeMarco said he did so after, he said, Suffolk District Attorney Thomas Spota declined to investigate. Spota denied the allegation.

Walsh and his attorneys had said the federal government was prosecuting him in order to gain information on political corruption in Suffolk, including in the selection of judges.

They maintained there was nothing illegal about how Walsh functioned in the political process, and that all of his actions were traditional and legal so he had nothing to offer in assisting any federal investigation.

Though the Conservative Party is a minority party, it is highly influential and its voters often provide the margin of victory in county elections. Party members are prominent in a number of county positions, including the judiciary and the sheriff’s department.

At trial, the government’s case against Walsh was based substantially on FBI agents comparing the time sheets Walsh had submitted to the sheriff’s department with the records of his locations based on his telephone, credit cards, golfing and gambling outings. In addition to golfing, gambling and politicking, an agent also testified that Walsh billed the sheriff’s department for time at his tailors and while at home.

advertisement | advertise on newsday

Defense attorneys maintained that Walsh was supposed to serve as a liaison for the sheriff’s department to government officials and the public, and that he had flexibility over when and where he worked. Government prosecutors argued that Walsh was supposed to be on duty at the sheriff’s department and that he was supposed to follow a regular schedule of shifts there.

Spota’s office has said previously that DeMarco’s claims the office declined to investigate are “fiction,” and investigators for DeMarco, who subsequently lost the Conservative Party renomination for sheriff, failed to show up at scheduled meetings to discuss the situation. A spokesman for Spota’s office did not immediately return a request for comment Tuesday.

Federal prosecutors have said that Spota’s office blocked DeMarco’s efforts to have the DA conduct the investigation.