Ethan Jaake Bodally, 22, of Stanks Drive, Swarcliffe, and Ben Anthony Bland, 21, of Poole Crescent, Cross Gates, were arrested on January 7 after police saw them acting suspiciously in the area of Royal Parade.
After being approached by the officers, Bland ran off.
Bodally remained at the scene and admitted to using a small amount of cannabis that officers found in his possession.
He also claimed to be visiting Harrogate to return a mobile phone to a relative.
Bland was arrested a short time later.
While the pair were being transported to police custody, officers received a call that a member of the public had seen someone matching Bland’s description dump something in a hedge.
Officers retrieved the item and it turned out to be a bag containing 102 wraps of crack cocaine and 44 wraps of heroin.
Both men were charged with possessing heroin and crack cocaine with intent to supply.
They pleaded guilty to the charges at York Crown Court earlier this year.
On Friday, December 11, Bodally was jailed for two years and ordered to forfeit a mobile phone and drugs paraphernalia.
Bland was given a two-year jail term suspended for two years and ordered to carry out unpaid work.
Detective Sergeant Marcus Dawson, of North Yorkshire Police’s Operation Expedite Team, said: “Just because you can’t see us, it doesn’t mean we’re not out there taking drug dealers off the streets.
“I hope local people are reassured that we continue to make drug dealing a priority and target the dealers who cross borders to make life a misery for local people.
“Please remember that your information is vital, as we have seen in this case, a call about the dumping of a package was instrumental in taking a large amount of drugs out of circulation.
“No matter how insignificant you think the information is, please call us. And if you don’t want to speak to us, you can pass information anonymously to Crimestoppers.”
What is 'county lines' drug dealing?
“County lines” is the term given to a form of organised crime in which drug dealers, usually from urban areas, target smaller towns and cities.
It takes its name from the mobile phone lines used by dealers to advertise drugs for sale.
Violence and intimidation is prevalent within county lines.
Due to the exploitation of vulnerable people associated with it, it is a key, operational priority for North Yorkshire Police.
A major concern for North Yorkshire Police is a practice known as cuckooing, which is where drug dealers take over the home of a vulnerable person and use it to store and sell drugs.
They often use violence and intimidation to achieve this.