Botanically speaking, a tomato is a fruit. It has an ovary and seeds of a flowering plant. But for many culinary uses, it is regarded as a vegetable.
Tomatoes are not the only ones that are botanically fruits yet cooked as vegetables. Other ambiguous food items include eggplants, squashes of all kinds, green beans, and cucumbers.
In fact, the debate whether a tomato is a fruit or vegetable has even landed in the United States Supreme Court. In May 1893, acting on tariff laws on vegetables, ruled that the tomato is a vegetable based on how it is used.