While it is botanically a fruit, the Tomato is considered a vegetable for culinary purposes (as well as under U.S. customs regulations), which has caused some confusion. Tomatoes are not the only food source with this ambiguity! Green beans, eggplants, cucumbers, and squashes of all kinds (such as zucchini and pumpkins) are all botanically fruits, yet cooked as vegetables.
The tomato belongs to the nightshade family. The species originated in the South American Andes and its use as a food originated in Mexico, and spread throughout the world following the Spanish colonization of the Americas.