It’s a question used to trick schoolkids the nation over: Is the tomato actually a fruit or vegetable?

Botanically, it’s a fruit. But legally, it’s not.

And the origins of that discrepancy lie in a 19th-century Supreme Court case so obscure, many tomato experts aren’t even aware of it.

“Tomatoes have such an outlandish history,” said George Ball, the chief executive at the seed company Burpee. “Most people hear it and are bewildered for life.”

As Ball explains it, fruits and vegetables differ in one major botanical way. A fruit is technically the seed-bearing structure of a plant — and a vegetable can be virtually any part of the plant we eat.

At the time of the court case in question, Nix v. Hedden, fruits and vegetables differed in another big way, as well: Imported vegetables were slapped with a 10-percent tariff upon their arrival in the United States, and imported fruits were not.

When one Manhattan wholesaler — John Nix & Company, owned by John Nix and his four sons — got hit with the tariff on a shipment of Caribbean tomatoes, he disputed the tax on the grounds that tomatoes were not technically vegetables.

The case, filed in 1887, made its way to the Supreme Court in 1893. There, the court disagreed with the Nixes, ruling that people neither prepare nor eat tomatoes like fruits — and that they should be taxed accordingly.

“Botanically speaking, tomatoes are the fruit of a vine, just as are cucumbers, squashes, beans, and peas,” wrote Justice Horace Gray in his 1893 opinion. “But in the common language of the people, whether sellers or consumers of provisions, all these are vegetables.”

The timing of Gray’s decision was fortuitous: It came during a period of radical transformation of the world’s fruit and vegetable trade. Once a series of largely local or regional markets, a new class of national wholesalers, like the Nixes, were beginning to introduce urban consumers to produce from much farther away.

According to news reports from the time, John Nix & Company were among the first to source produce from Florida, California and Bermuda, even chartering a steamship to bring onions back faster. The firm exported fruit to Europe, and returned with imported European potatoes. At the time of the junior John Nix’s death, in 1922, the company had opened a second office in Chicago to accommodate the growing long-distance flow of fruits and vegetables.

In 1937, when the League of Nations sought to classify fruits, vegetables and other goods for the purpose of coordinating tariffs, tomatoes ended up under “vegetables / edible plants / roots and tubers.” (A documentation official at the World Customs Organization said the Gray ruling may have been at play.)

That doesn’t mean the question is settled. Several states have rebelled: Tennessee and Ohio have named the tomato their state fruit — though New Jersey has made it the state vegetable, specifically citing Nix v. Hedden.

To further complicate matters, the European Union issued a directive in December 2001 classifying tomatoes as fruit — along with rhubarb, carrots, sweet potatoes, cucumbers, pumpkins and melons.

But to Burpee’s George Ball, the two classifications shouldn’t be mutually exclusive. His company’s logic — rather like Justice Gray’s — is that plants should be described according to their usage.

“Are [tomatoes] fruits? Of course,” he said. “Are they vegetables? You bet.”