SAO PAULO (Reuters) - Brazilian healthcare regulator Anvisa on Monday said it had issued the country’s first license for sale of a cannabis-based drug in the country after years of legal wrangling with patients.

The multiple sclerosis treatment, an oral spray derived from marijuana and developed by Britain’s GW Pharmaceuticals PLC, is known as Sativex internationally and will be sold in Brazil under the brand name Mevatyl.

The legal status of cannabis-based drugs has been a thorny issue in Brazil for years, with several patients fighting in the courts to circumvent prohibition. Anvisa has loosened some restrictions in the past two years, allowing patients with medical orders to personally import some drugs derived from marijuana.

GW Pharmaceuticals, founded in 1998 to explore the medical potential of marijuana, has emerged as a takeover target for larger pharmaceutical companies after recent breakthroughs on the cannabis-based epilepsy treatment Epidolex.

São Paulo-based Beaufour Ipsen Farmacêutica Ltda will hold the Brazilian distribution license for Sativex, which is already sold in 28 other countries, according to Anvisa.

Brazil decriminalized growing and possessing small amounts of marijuana and other drugs more than a decade ago, but buying and selling remains illegal.

Drug trafficking, particularly from the world’s top two cocaine producers, Colombia and Peru, remains a major security and healthcare concern in Brazil.

In 2013, neighboring Uruguay became the first country to legalize cultivation, distribution and consumption of marijuana, seeking to wrest the business from criminals in the small South American nation.