BOSTON — A Harvard Business School instructor who blasted a Boston-area Chinese restaurant for overcharging him by $4 on a takeout order apologized Wednesday for a lengthy and widely publicized email exchange with restaurant management.

Associate professor Benjamin Edelman had threatened legal action and demanded the Sichuan Garden in Brookline compensate all other customers who might have been similarly overcharged after he said it charged him $1 more on each of the four items he ordered for takeout last week.

But after facing wide criticism, Edelman posted a brief message on his personal website saying he has reached out to apologize to Ran Duan, who helps manage his parent’s restaurant business: “Having reflected on my interaction with Ran, including what I said and how I said it, it’s clear that I was very much out of line. I aspire to act with great respect and humility in dealing with others, no matter what the situation. Clearly I failed to do so. I am sorry, and I intend to do better in the future.” In emails first made public by boston.com, Duan acknowledged to Edelman that the prices listed on the restaurant’s website were out of date. He promised to update them soon and offered to refund the overages.

But Edelman, who consults for AOL, Microsoft, the NFL, Wells Fargo, the New York Times, among many others on “preventing and detecting online fraud,” according to his personal website, accused the restaurant of systematically overcharging customers.

He demanded a $12 refund, arguing that he was eligible for triple damages under the state’s consumer protection statute. Edelman, a Brookline resident, also contacted local officials to demand the restaurant compensate all other customers who might have been affected.

“It strikes me that merely providing a refund to a single customer would be an exceptionally light sanction for the violation that occurred,” he wrote in one of the exchanges with Duan. “You don’t seem to recognize that this is a legal matter and calls for a more thoughtful and far-reaching resolution.”

At one point, after a flurry of email exchanges, Duan, who generally remained respectful in his replies to Edelman, wrote: “Like I said, I apologize for the confusion, you seem like a smart man, but is this really worth your time?”

The spat between the well-to-do professor and Duan’s self-described “mom and pop” restaurant became a flashpoint on social media.