A class-action lawsuit about overtime pay for truck drivers hinged entirely on a debate that has bitterly divided friends, families and foes: The dreaded — or totally necessary — Oxford comma, perhaps the most polarizing of punctuation marks.

What ensued in The United States Court of Appeals for the First Circuit, and in a 29-page court decision handed down on Monday, was an exercise in high-stakes grammar pedantry that could cost a dairy company in Portland, Me., an estimated $10 million.

In 2014, three truck drivers sued Oakhurst Dairy, seeking more than four years' worth of overtime pay that they had been denied. Maine law requires workers to be paid 1.5 times their normal rate for each hour worked after 40 hours, but it carves out some exemptions.

More from New York Times:

Using Sling TV and secure texts to keep on top of Trump

Russian agents were behind Yahoo hack, U.S. says

British regulators to investigate 21st Century Fox's deal for sky

A quick punctuation lesson before we proceed: In a list of three or more items — like "beans, potatoes and rice" — some people would put a comma after potatoes, and some would leave it out. A lot of people feel very, very strongly about it.

The debate over commas is often a pretty inconsequential one, but it was anything but for the truck drivers. Note the lack of Oxford comma — also known as the serial comma — in the following state law, which says overtime rules do not apply to:

The canning, processing, preserving, freezing, drying, marketing, storing, packing for shipment or distribution of: (1) Agricultural produce; (2) Meat and fish products; and (3) Perishable foods.

Does the law intend to exempt the distribution of the three categories that follow, or does it mean to exempt packing for the shipping or distribution of them?

Delivery drivers distribute perishable foods, but they don't pack the boxes themselves. Whether the drivers were subject to a law that had denied them thousands of dollars a year depended entirely on how the sentence was read.

If there were a comma after "shipment," it might have been clear that the law exempted the distribution of perishable foods. But the appeals court on Monday sided with the drivers, saying the absence of a comma produced enough uncertainty to rule in their favor. It reversed a lower court decision.

In other words: Oxford comma defenders won this round.

"That comma would have sunk our ship," David G. Webbert, a lawyer who represented the drivers, said in an interview on Wednesday.

The language in the law followed guidelines in the Maine Legislative Drafting Manual, which specifically instructs lawmakers to not use the Oxford comma. Don't write "trailers, semitrailers, and pole trailers," it says — instead, write "trailers, semitrailers and pole trailers."

The manual does clarify that caution should be taken if an item in the series is modified. Commas, it notes, "are the most misused and misunderstood punctuation marks in legal drafting and, perhaps, the English language."

"Use them thoughtfully and sparingly," it cautions.

Legal history is replete with cases in which a comma made all the difference, like a $1 million dispute between Canadian companies in 2006 or a very costly insertion of a comma in an 1872 tariff law.

Varying interpretations of a comma in the Second Amendment have figured in court decisions on gun laws, including a Federal District Court overturning a Washington gun ordinance in 2007. (The Supreme Court later upheld the law in the case known as District of Columbia v. Heller.)

Most American news organizations tend to leave the Oxford comma out while allowing for exceptions to avoid confusion, like in the sentence: "I'd like to thank my parents, Mother Teresa and the pope."

Reporters, editors and producers at The New York Times usually omit the comma, but Phil Corbett, who oversees language issues for the newsroom, wrote in a 2015 blog post that exceptions are sometimes made:

"We do use the additional comma in cases where a sentence would be awkward or confusing without it: Choices for breakfast included oatmeal, muffins, and bacon and eggs."

The Associated Press, considered the authority for most American newsrooms, also generally comes out against the Oxford comma.

But the comma is common in book and academic publishing. The Chicago Manual of Style uses it, as does Oxford University Press style. "The last comma can serve to resolve ambiguity," it says.

A 2014 survey of 1,129 Americans by FiveThirtyEight and SurveyMonkey Audience found 57 percent in favor of the comma and 43 percent opposed.

Mr. Webbert, who said working on the case recalled his boyhood grammar and Latin lessons, scoffed at the idea that he was representing all those in favor of the Oxford comma. He was only representing the truck drivers, he said.

The drivers, who earned between $46,800 and $52,000 per year without overtime, worked an average of 12 extra hours a week, Mr. Webbert said. Though three drivers filed the class-action lawsuit in 2014, about 75 will share the money.

Oakhurst, a third-generation family business that employs about 200 people and has annual sales of $110 million, sells dairy products throughout New England, according to its website. Its president, John H. Bennett, did not return a call on Wednesday.

Mr. Webbert declined to take a personal position on the broader debate of using the Oxford comma. But he sounded like a lot of English teachers and writing coaches who offered an alternative suggestion: If there's any doubt, tear up what you wrote and start over.

"In this situation, it did create an ambiguity, which means you have to either add a comma or rewrite the sentence," he said.