We report the first in situ detection of boron on Mars. Boron has been detected in Gale crater at levels Curiosity rover ChemCam instrument in calcium-sulfate-filled fractures, which formed in a late-stage groundwater circulating mainly in phyllosilicate-rich bedrock interpreted as lacustrine in origin. We consider two main groundwater-driven hypotheses to explain the presence of boron in the veins: leaching of borates out of bedrock or the redistribution of borate by dissolution of borate-bearing evaporite deposits. Our results suggest that an evaporation mechanism is most likely, implying that Gale groundwaters were mildly alkaline. On Earth, boron may be a necessary component for the origin of life; on Mars, its presence suggests that subsurface groundwater conditions could have supported prebiotic chemical reactions if organics were also present and provides additional support for the past habitability of Gale crater.