We report on the VERITAS detection of very-high-energy (VHE, $E > 100~\mathrm{GeV}$) $\gamma$-ray emission from the optically bright quasar OJ~287 which is located at a redshift of z = 0.306. OJ~287 has been observed to display regular optical outbursts with a period of approximately 12 years, with the last major optical outburst having occurred in 2015. To explain this periodicity, models involving a binary supermassive black hole system at the core of OJ~287, or a helical jet, have been developed. Motivated by elevated {\it Swift}-XRT count rates, VERITAS observed OJ~287 in February 2017, and detected the object at >5 standard deviations above background. This detection prompted further VERITAS, {\it Swift}-XRT and multiwavelength observations of the object. The results of the VERITAS observational campaign are presented.