Where Did Heroin Originate?

Heroin is derived from opium which originated in Afghanistan. Heroin was actually invented to cure people addicted to morphine, another drug from opium.