A Calne man who claimed he could not work after a double hip replacement was operating as a fencing contractor for Chippenham Town Council.
John Snell, 67, claimed more than £50,000 in benefits saying he as was unable to work following the operations.
But in reality Snell, who was also in receipt of two work pensions, was going out each morning as a self-employed fencer.
And among his contracts he was working for Chippenham Town Council, Swindon Crown Court was told.
Paul Grumbar, prosecuting, told the court that Snell is a married man who started claiming pension credit in August 2006, along with council tax benefit.
Prior to receiving the payments he said he was getting incapacity benefit, he told the court.
They launched an investigation after getting a tip off he was working as a fencing contractor and found he was working for Citadel and the town council.
When he was questioned about the matter he said he started claiming benefits when he was unable to work as a result of hip replacements.
"He failed to tell the department he was working as a self-employed fencing contractor and has two private pensions," Mr Grumbar said.
Mr Grumbar said he received £48,393.43p in pension credits and £3,090.66p in council tax benefit between August 2006 and August 2012, making a total loss of £51,484.09p.
Snell, of Heron Close, Calne, pleaded guilty to three counts of making a dishonest representation to obtain benefits when he appeared at crown court.
Mike Pulsford, defending, said the claim had started when his client was laid up and he just failed to say when he was fit to resume work.
He said he was on disability living allowance in 2007 and 2008 after having both hips replaced.
"He says 'all I want to do is go out day by day and work'. That has been the foremost motive for him," he said.
"When it was pointed out to him last year he was claiming these benefits he ought not to he said 'I don't know how the Pension Credits work'.
"He said he was told at the age of 60 he was told that pension credit was available to top up his earnings.
"At that time he received disability living allowance which is not income dependant and he just carried on putting his head in the sand.
"When he was back working full time he left things as they were. It is a huge figure, he is shocked."
He said he and his wife had downsized to a house without a mortgage during the past seven years and had not been living a life of luxury.
The pensions, which should have been declared, only paid out £40 a month for one and £400 a year for the other.
"He has be chastened by these proceedings and they are not over yet with the Proceeds of Crime Act proceedings."
He said he may have to sell his house to meet the final bill when he has to repay what he received.
Judge Philip Wassall said: "It is rather difficult to avoid, the payments are being made because you can't work.
"If you return it is obviously something is going to change with the pension. The onus is on you. It was only the result of good investigation that led to it being detected.
"£51,000 of public money has gone into your accounts, to someone who works in cash strapped public services that is probably, over a two years, gross income to someone in public service. People feel angered by this type of activity."
He imposed a 24-week jail term suspended for two years and ordered him to do 240 hours of unpaid work for the community.