BOSTON (NEWSnet/AP) — Massachusetts Attorney General Andrea Campbell announced a $3.5 million settlement Friday with the online food delivery service platform Grubhub.

The settlement resolves a 2021 lawsuit brought by Campbell alleging Grubhub illegally overcharged fees to Massachusetts restaurants in violation of a state fee cap put in place during the COVID-19 public health emergency.

Under the terms of the settlement, Grubhub will pay a combined total of over $3.5 million to impacted restaurants, Campbell said. Grubhub will also pay $125,000 to the state.

“Grubhub unlawfully overcharged and took advantage of restaurants during a public health emergency that devastated much of this industry,” Campbell said in a statement.

Grubhub contracts with restaurants to provide online customer ordering and delivery services and charges fees to contracted restaurants per customer order. The fees are generally charged as a certain percentage of the restaurant menu price of each order.

Massachusetts declared a public health state of emergency during the height of the COVID-19 pandemic.

During the emergency — when diners increasingly relied on delivery — lawmakers approved legislation barring Grubhub and other third-party delivery service platforms from charging fees to restaurants exceeding 15% of an order’s restaurant menu price.

The fee cap remained in effect between Jan. 14, 2021, and June 15, 2021, when former Gov. Charlie Baker lifted the state of emergency in Massachusetts.

The AG’s lawsuit, filed in July 2021, alleged Grubhub repeatedly violated the 15% fee cap by regularly charging fees of 18% or more, leading to significant financial harm to restaurants by often raising their operational costs by thousands of dollars.

In March 2023, Suffolk Superior Court ruled in favor of the state. The ruling indicated Grubhub’s conduct had violated both the 15% statutory fee cap and the state’s primary consumer protection statute, according to Campbell.

Restaurants who may be eligible to receive funds from the settlement will be contacted, Campbell said.