A DRUG dealer has narrowly avoided jail after being caught red-handed with more than 100 Ecstasy pills.

Former drug addict James Mills, 21, of Hawthorne Avenue, Haxby, was sentenced to a suspended nine-month jail term and 200 hours community service by a judge at York Crown Court yesterday.

The court heard how, on September 23 last year, Mills was arrested in King Street in York centre after police were called out to a fight in the street.

No charges were placed against Mills in relation to the fight, but when searched by police, Mills was found to have 42 Ecstasy pills on him.

A further 62 tablets were found in his car which was parked outside his girlfriend's house in Moor Avenue, Tang Hall, York.

David Garnett, prosecuting, told the court the pills had a combined street value of about £100, but that if sold separately they could fetch between £3 and £5 - sold as a batch, their value could be as little as 25p each.

Mills pleaded guilty to possessing controlled drugs with intent to supply.

But defence barrister Simon Reevell said the drugs were not intended to be sold on the street, but to Mills's friends.

He said: "There is a world of difference between this case and one where the defendant is engaged in commercial supply.

"This young man is not dealer material. He said he'd do someone else a favour.

"He'd taken the drugs out with him for people he was seeing that evening and the others for other people were left in the car.

"He's the sort of young man who gets himself into stupid situations and, unfortunately, he's let that stray into the serious this time."

The court heard that Mills was also the subject of a suspended sentence order imposed by York Magistrates Court for an affray which took place after the drugs incident in November last year.

Sentencing, the Recorder of York, Judge Paul Hoffman warned Mills that any breach of his order could land him in jail.

He said: "Just in case you think I'm joking, I will require any breach to come back before me, and I warn you you'd be ill- advised to breach my sentence.

"If any of your friends are sitting in the back of the court, I hope they take notice of how close you have come to custody today."