  This paper reports the observation of the decays $B_{(s)}^{0}\to
D_{s1}(2536)^{\mp}K^{\pm}$ using proton-proton collision data collected by the
LHCb experiment, corresponding to an integrated luminosity of
$9\,\mathrm{fb}^{-1}$. The branching fractions of these decays are measured
relative to the normalisation channel $B^{0}\to \overline{D}^{0}K^{+}K^{-}$.
The $D_{s1}(2536)^{-}$ meson is reconstructed in the
$\overline{D}^{*}(2007)^{0}K^{-}$ decay channel and the products of branching
fractions are measured to be $$\mathcal{B}(B_{s}^{0}\to
D_{s1}(2536)^{\mp}K^{\pm})\times\mathcal{B}(D_{s1}(2536)^{-}\to\overline{D}^{*}(2007)^{0}K^{-})=(2.49\pm0.11\pm0.12\pm0.25\pm0.06)\times
10^{-5}, $$ $$\mathcal{B}(B^{0}\to
D_{s1}(2536)^{\mp}K^{\pm})\times\mathcal{B}(D_{s1}(2536)^{-}\to\overline{D}^{*}(2007)^{0}K^{-})
= (0.510\pm0.021\pm0.036\pm0.050)\times 10^{-5}.$$ The first uncertainty is
statistical, the second systematic, and the third arises from the uncertainty
of the branching fraction of the $B^{0}\to \overline{D}^{0}K^{+}K^{-}$
normalisation channel. The last uncertainty in the $B_{s}^{0}$ result is due to
the limited knowledge of the fragmentation fraction ratio, $f_{s}/f_{d}$. The
significance for the $B_{s}^{0}$ and $B^{0}$ signals is larger than
$10\,\sigma$. The ratio of the helicity amplitudes which governs the angular
distribution of the $D_{s1}(2536)^{-}\to\overline{D}^{*}(2007)^{0}K^{-}$ decay
is determined from the data. The ratio of the $S$- and $D$-wave amplitudes is
found to be $1.11\pm0.15\pm 0.06$ and its phase $0.70\pm0.09\pm 0.04$ rad,
where the first uncertainty is statistical and the second systematic.
