  The first search for ultra-rare $K^+$ decays into the $\pi^+e^+e^-e^+e^-$
final state is reported, using a dataset collected by the NA62 experiment at
CERN in 2017-2018. An upper limit of $1.4\times 10^{-8}$ at 90% CL is obtained
for the branching ratio of the $K^+\to\pi^+e^+e^-e^+e^-$ decay, predicted in
the Standard Model to be $(7.2\pm0.7)\times 10^{-11}$. Upper limits at 90% CL
are obtained at the level of $10^{-9}$ for the branching ratios of two prompt
decay chains involving pair-production of hidden-sector mediators:
$K^+\to\pi^+aa$, $a\to e^+e^-$ and $K^+\to\pi^+S$, $S\to A^\prime A^\prime$,
$A^\prime\to e^+e^-$.
