A Keighley drug dealer has been jailed for three years after a judge was shown CCTV footage of his dramatic arrest by undercover police officers.

The video shown at Bradford Crown Court captured the moment when officers in unmarked vehicles boxed in Arshad Ali's Mazda car just after a suspected drugs transaction in Damside.

Prosecutor Michael Smith described how the 30-year-old's car collided with two of the police vehicles, writing one of them off, as he tried to get away from the scene on the late morning of October 3 last year.

''Officers got out of their vehicles and smashed the windows of the defendant's car as he continued to rev the engine and try to push back the police car,'' said Mr Smith.

As he was being arrested Ali threw a mobile phone and a bag into the foot-well of the Mazda and police later recovered almost 30 packages of heroin and crack cocaine worth about £100.

Mr Smith said text messages found on the phone ''advertised'' the fact that Ali was in the business of supplying drugs on the street and one of the texts had been sent to 80 contacts.

After his arrest heroin addict Ali, of Dalton Terrace, Keighley, claimed that he had only been delivering some drugs under duress.

''He said he had had a gun held to his head and been asked to deliver some drugs,'' said Mr Smith.

But Mr Smith said the text messages were evidence that Ali was involved in an on-going street dealing business.

Ali, who had previous convictions dating back to 2002, pleaded guilty in April to possessing heroin and crack cocaine with intent to supply and careless driving.

Barrister Mohammed Nawaz, for Ali, said he was a long-term user of heroin whose life had been blighted by his misuse of the drug.

Mr Nawaz said his client was involved in dealing to fund his own habit and to pay off a drugs debt to his suppliers.

Judge Jonathan Rose said Ali had played a significant role in perpetuating drug addiction and misery for addicts on the street and had advertised his ''wares'' by electronic means to some 80 customers.

''The deals may have been small but they were going to be numerous,'' said the judge.

''You were fully engaged in this and a significant custodial sentence is called for.''

The judge warned Ali that his next sentence for any similar offending would be seven years in prison, but said that would only be if he did not kill himself with his own drug addiction before then.

Ali was also banned from driving for a year for the careless driving offence.