Marijuana has been used as a medicinal drug for achieving euphoria since ancient times. Its use spread from China to India and then to North Africa and reached Europe at least as early as A.D. 500.
The first direct use dates from 2737 BC, in the writings of the Chinese emperor Shen Nung. It found its main use as a medication for rheumatism, gout, malaria, and oddly enough, absent-mindedness. Knowing of its intoxicating properties, the medicinal value was considered more important. In India though it was clearly used recreationally. The Muslims used it recreationally for alcohol consumption. It was the Muslims who introduced hashish, whose popularity spread quickly throughout 12th century Iran and North Africa.