Outside Lands is no stranger to pot. This year, it will be legal.

For the first time, San Francisco’s largest summer music festival has won approval for cannabis sales and a designated smoking area at the three-day event, which starts Friday in Golden Gate Park.

“It’s going to be a landmark moment for the end of prohibition,” said Alex Fang, a co-founder of Sublime, an Oakland cannabis firm that will sell infused mints and freeze pops at the festival.

On Wednesday, the San Francisco Office of Cannabis said it would grant its first permit for a temporary event where cannabis is sold. The agency only recently approved new rules for such events.

Alex Traverso, a spokesman for the Bureau of Cannabis Control, said in an email later Wednesday that the state agency would also issue a license for Outside Lands in time for the event.

It is generally illegal to use cannabis in public in California, though the state legalized the drug for recreational use in 2016.

The festival will transform an area of the park into a sprawling marijuana exhibit called Grass Lands. It will feature about a dozen cannabis companies, mostly licensed vendors whose products are sold on San Francisco marijuana delivery app Eaze, which is also a sponsor. The city’s new regulations require that the areas for consumption remain separate from where cannabis is sold, so that sellers aren’t impacted by secondhand smoke, the city agency said. Both areas must be hidden from view by an opaque barrier.

Festivalgoers may buy up to 7 grams of non-concentrated cannabis, like dry plant material, and 2 grams of cannabis concentrates, which are found in vape pens and edibles, across all vendors.

In the days leading up to the festival, vendors had not known if the approvals would come through.

“I’m in the cannabis business, so uncertainty is kind of my thing,” said Chelby Dufourg, president of sales at Los Angeles cannabis firm Field, which paid to be a sponsor of the festival’s marijuana exhibit.

A spokeswoman for the festival’s media agency Grandstand did not respond to requests for comment, and festival organizers Another Planet Entertainment and Superfly also did not reply to emails.

On Monday, the festival’s website had an empty page titled “cannabis.” It has since been deleted.

Other festivals in California have been greenlit for cannabis by the state agency. In May, a much smaller music festival in Mendocino County, Northern Nights, had legal cannabis sales.

Fang, whose company Sublime recently started selling cannabis freeze pops in flavors like blue raspberry, said the exposure of a booth at Outside Lands could be huge for his business.

“This is our first investment ever in marketing, and I’m a little bit nervous about it,” he said.

Melia Russell is a San Francisco Chronicle staff writer. Email: melia.russell@sfchronicle.com Twitter: @meliarobin