  The first observation of the decay $B^0 \rightarrow D^0 \overline{D}{}^0 K^+
\pi^-$ is reported using proton-proton collision data corresponding to an
integrated luminosity of 4.7 $\mathrm{fb}^{-1}$ collected by the LHCb
experiment in 2011, 2012 and 2016. The measurement is performed in the full
kinematically allowed range of the decay outside of the $D^{*-}$ region. The
ratio of the branching fraction relative to that of the control channel $B^0
\rightarrow D^{*-} D^0 K^+$ is measured to be $\mathcal{R} = (14.2 \pm 1.1 \pm
1.0)\%$, where the first uncertainty is statistical and the second is
systematic. The absolute branching fraction of $B^0 \rightarrow D^0
\overline{D}{}^0 K^+ \pi^-$ decays is thus determined to be $\mathcal{B}(B^0
\rightarrow D^0 \overline{D}{}^0 K^+ \pi^-) = (3.50 \pm 0.27 \pm 0.26 \pm 0.30)
\times 10^{-4}$, where the third uncertainty is due to the branching fraction
of the control channel. This decay mode is expected to provide insights to
spectroscopy and the charm-loop contributions in rare semileptonic decays.
