Shamel Sudeene-Darien, 27, of Rosewell Close, was stopped by police in Horsham, Surrey, on suspicion of drug dealing.
He was found to have five wraps of heroin and six wraps of suspected crack cocaine.
Police then searched a rented address in Horsham where the young child in his care was found alone.
The address contained numerous hazards for a young toddler including drugs and weapons.
Detective Inspector Rebecca Hopkins said: “There were hazards in the address which included access to an unlocked rooftop balcony, uncovered electrical sockets, and loose wires from a television and lamp.
“Most worryingly, there were also wraps of class A drugs in the property that would be easily swallowable for a young child.
“There was no accessible food or water for the child, overall it was not a safe place for the child to be in.”
Shamel Sudeene-Darien (Image: Sussex Police) His phones showed further evidence that he was supplying drugs in the area and £1,000 in cash was found in the property.
Sudeene-Darien, who was unemployed, was charged with nine offences including child neglect and possession of an offensive weapon in public – a screwdriver.
He was also charged with possession of heroin and crack cocaine with intent to supply, being concerned in the supply of heroin and crack cocaine, being concerned in the supply of cannabis, acquiring, using or possessing criminal property.
On March 11 at Lewes Crown Court he was jailed for three years.
DI Hopkins said: “Officers acted professionally to ensure the child was appropriately safeguarded while Sudeene-Darien was in custody.
“This case shows our determination to disrupt County Lines drugs groups who cause harm in our communities.
“We are pleased that because of our investigation, Sudeene-Darien had no choice but to plead guilty when presented with the evidence in court.”