A former soldier who set up a cannabis factory after falling into debt has walked free from court.

Carlos Perez, 40, grew hundreds of plants in rooms above his shop in busy Western Road, Hove.

He grew his crop on the top floor of his failing business, the Paint Emporium, to try to make money as his debts mounted to more than £500,000.

But he was caught out in February when the hydroponic system he used to water and feed the crop sprang a leak.

Water dripped from the top floor rooms into the shop below and was seeping out of the front door.

The flood was spotted by a passing police officer who alerted the emergency services and the factory was discovered.

Police found two 15ft square rooms were used to grow the drug.

The plants were in various stages of growth, including some hanging up to dry.

As well as the hydroponic growing system, extra air fans which led to the chimney were also installed.

Perez, of Woodlands Close, Horsham, admitted producing cannabis and possessing the class C drug with intent to supply at an earlier court hearingand was warned he may face jail.

But when he appeared at Lewes Crown Court for sentence, Judge Simon Coltart said he had taken into consideration Perez's exemplary military service and the fact he had no previous convictions.

Perez was ordered to carry out 200 hours of a community punishment order and to pay £400 costs.

The court heard the drugs could have had a street value of £23,000.

A further hearing will be held to decide confiscation of any profits he made from the cannabis.

John Upton, defending, said Perez, who served in the special forces during his eight-year military career, struggled for several years to create a successful business.

But he had ended up in debt to his former partner's mother, his own mother and his aunt.

Mr Upton said: "He tried unsuccessfully to make a legitimate living for some years.

"He turned to this venture in absolute desperation to try to find a way of repaying them.

"It was not in any way to fund an extravagant or a criminal lifestyle.

"It was an act of utter desperation to try to find some way of repaying these ladies."

He said the three women knew nothing about the criminal activity.