A couple who ran a cannabis factory have been jailed despite using most of the proceeds of their illicit activities to help a Kenyan village where they were regular visitors.

Michael Foster, 62, and Susan Cooper, 63, made hundreds of thousands of pounds from a sophisticated cannabis growing operation at their Lincolnshire farmhouse, which was only discovered when a police officer chasing a burglar recognised the distinctive smell. It was described by Lincoln crown court as "the most unusual cannabis growing case of this type".

The couple paid for live-saving surgery for a villager near Mombasa, Kenya, purchased computers for an eye hospital, and paid for schooling for children, the court heard.

But their philanthropic activity was funded by growing cannabis at their farmhouse in Little Sutton, which was raided by police in June 2010.

Prosecutor Jon Dee told the court: "The couple were both in their 60s and were of previous good character. For six years, they produced cannabis in significant quantities. It perhaps can be best summed up by Mr Foster, who told police in his own words during his interview that it started off as a hobby and turned into a business." They were only caught when a police officer was chasing a burglar near their home.

"At the time this couple were completely off the police radar," Dee said. "They were caught completely by chance." The police recovered £20,000 in a carrier bag and 159 cannabis plants, with an estimated value of £20,000, describing it as a "professional and commercial set up". The annual electricity bill for the farmhouse had increased by £2,000, which the couple claimed was because they were running a pottery business with a kiln.

Bank statements showed that £300,000 had been paid into their joint account over six years from 2004. A further £100,000 had gone into an account held by Cooper.

They admitted four charges of producing cannabis and a single offence of possessing criminal money.

Gareth Wheetman, mitigating for Foster, said the fact they were repeatedly flying off to Kenya in itself required money. "But the evidence demonstrates much of the money was put to charitable and good use. While in Kenya they bought a computer for a local eye hospital, paid for children to be put through school and paid for a lifesaving operation on a man's gangrenous leg."

Chris Milligan, mitigating for Cooper, described her as a "good person who has done a bad thing". He said there was another side to her. "She has been a good mother, wife and partner to Mr Foster," he said. "She paid for the treatment of the young adult with a gangrenous infection in his leg who was given two days to live."

Judge Sean Morris, jailing them both for three years, said they were a respectable couple of positive good character. He said: "You were growing it on a significant scale, jetting off to Kenya on it. I am sure you were doing good things in Kenya with your drugs money, whether that was to appease your consciences, I can only speculate."