Axionlike particles (ALPs) are predicted in many extensions of the standard model, and their masses can naturally be well below the electroweak scale. In the presence of couplings to electroweak bosons, these particles could be emitted in flavor-changing B meson decays. We report herein a search for an ALP, a, in the reaction B^{±}→K^{±}a, a→γγ using data collected by the BABAR experiment at SLAC. No significant signal is observed, and 90% confidence level upper limits on the ALP coupling to electroweak bosons are derived as a function of ALP mass, improving current constraints by several orders of magnitude in the range 0.175 GeV