E-cigarette maker Juul Labs Inc has agreed to pay $40 million to North Carolina to settle a lawsuit by the state accusing it of marketing its products to minors.

The settlement, announced on Monday by North Carolina Attorney General Josh Stein, is the first reached by the company with a state government. The deal also includes restrictions on sales of products that appeal to minors and requires Juul to produce yearly reports demonstrating its compliance.

Stein told a news conference he began investigating Juul after “hearing from friends about the devastation that this product had visited on kids’ lives – addiction, depression, bad grades, switching schools, medical treatment and more.”

In a statement, Juul said: “This settlement is consistent with our ongoing effort to reset our company and its relationship with our stakeholders, as we continue to combat underage usage and advance the opportunity for harm reduction for adult smokers.”

Juul’s e-cigarettes resemble USB flash drives and work by vaporizing a nicotine-laced liquid. In its 2019 lawsuit, North Carolina said the company downplayed the potential harm its products can cause, fueling an “epidemic” of vaping among minors.

Under pressure from regulators, the company had already pulled popular flavors such as mango and cucumber from retail store shelves and shut down its social media channels on Instagram and Facebook

Juul, in which Marlboro maker Altria Group took a 35 percent stake in 2018, still faces more than 2,000 lawsuits over its e-cigarette marketing. The U.S. Federal Trade Commission in March asked it and other e-cigarette makers to hand over sales and advertising data.