Brazil's health watchdog on Tuesday approved the sale of cannabis-based products for medical use in pharmacies to people with a prescription.
The regulation, which takes effect in the coming months, also allows for the manufacture of such products in a laboratory, the Brazilian Health Regulatory Agency (Anvisa) said in a statement.
Anvisa is analyzing the possibility of permitting the cultivation of medical cannabis.
In recent years, several countries in Latin America have legalized cannabis for medical use, including Uruguay, Chile, Colombia, Argentina, Mexico and Peru.
President Jair Bolsonaro has previously expressed support for medical cannabis. But the ultraconservative leader would "not permit loopholes in the law to be used for the planting and consumption of marijuana," his spokesman Otavio Rego Barros told reporters in August.
Since 2015, Anvisa has allowed people with a medical prescription to import cannabidiol, or CBD, a non-psychoactive marijuana derivative, for the treatment of epilepsy and chronic illnesses.
The new regulation allows for the sale of products with a concentration of tetrahydrocannabinol, or THC -- the main psychoactive constituent responsible for marijuana's intoxicating effects -- of more than 0.2 percent to terminally ill patients or those who have exhausted alternative treatment options.
Others will be allowed to buy medical cannabis products with a THC concentration of less than 0.2 percent.