By Katie Johnston Globe Staff,Updated March 30, 2023, 6:28 p.m.

The delivery service Gopuff has been fined more than $6.2 million for misclassifying an estimated 968 drivers as independent contractors, in addition to other labor violations, Attorney General Andrea Campbell announced Thursday. The company delivers groceries, alcohol, and home goods stocked in warehouses to customers nationwide, including in 35 cities and towns in Greater Boston, the North Shore, and Worcester County.

The bulk of the fine, $4.84 million, is for incorrectly categorizing drivers, who sign up for shifts at a handful of Gopuff facilities around the state, called micro-fulfillment centers, and make deliveries as orders come in. Under state law, workers are considered employees — with the right to minimum wage, overtime pay, unemployment insurance, and other worker protections — if their duties are directed by the company, they don’t have an independently established business, or they perform jobs that are part of the company’s regular course of business.

The fine is believed to be the highest amount ever levied for misclassifying employees. The attorney general is required to consider a number of factors when determining penalties, including the number of workers affected, previous infractions, the size of the company’s payroll, the monetary impact of the violations, and the intent to violate the law.

The investigation, which took place from January to September 2022, also found that Gopuff failed to supply paystubs to drivers detailing their hours and pay and did not provide paid sick time, as required for employees by state law.

“When employers misclassify their workers, they deprive them of basic employee protections and benefits, and create an unfair playing field for other law-abiding companies,” Campbell said in a statement. “My office is committed to protecting Massachusetts workers and will hold companies who deny their employees basic protections accountable for their misconduct.”

Gopuff said in a statement that it strongly disagreed with the fine and planned to appeal.

We remain committed to listening to our delivery partners who tell us time and time again that they value their flexibility as independent contractors and are continuously working to improve the experience,” a company spokeswoman said.

Workers who want to be regular employees with benefits can work at the company’s micro-fulfillment centers or in its Philadelphia headquarters, she said, noting that a quarter of its drivers are single parents and half have another job. The attorney general’s claims about paystubs and paid sick time don’t apply to independent contractors, she noted.

Gopuff was started in 2013 by two sophomores at Drexel University in Philadelphia, Rafael Ilishayev and Yakir Gola, who realized that Gola was running countless errands for their friends because he was the only one with a car, according to the company’s website. So they created an app and started making deliveries around campus from the back of Plymouth Voyager. Today, the company has hundreds of locations, thousands of workers, and operates around the United States and Europe.

The use of independent contractors by app-based companies has sparked a contentious debate over workers’ rights around the country. In Massachusetts, the state is embroiled in a lawsuit against Uber and Lyft for misclassifying drivers, and last year the Supreme Judicial Court struck down a proposed ballot question backed by the tech industry that would have formally established gig economy workers as independent contractors.

bill filed this year, backed by several unions, would give gig workers access to employee protections including a guaranteed minimum wage, paid sick time, unemployment insurance, and collective bargaining rights, but would not seek to make them employees.