  The co-existence of ferromagnetism and superconductivity becomes possible
through unconventional pairing in the superconducting state. Such materials are
exceedingly rare in solid-state systems but are promising platforms to explore
topological phases, such as Majorana bound states. Theoretical investigations
date back to the late 1950s, but only a few systems have so far been
experimentally identified as potential hosts. Here, we show that
atomically-thin niobium diselenide (NbSe$_2$) intercalated with dilute cobalt
atoms spontaneously displays ferromagnetism below the superconducting
transition temperature ($T_c$). We elucidate the origin of this phase by
constructing a magnetic tunnel junction that consists of cobalt and
cobalt-doped niobium diselenide (Co-NbSe$_2$) as the two ferromagnetic
electrodes, with an ultra-thin boron nitride as the tunnelling barrier. At a
temperature well below $T_c$, the tunnelling magnetoresistance shows a bistable
state, suggesting a ferromagnetic order in Co-NbSe$_2$. We propose a RKKY
exchange coupling mechanism based on the spin-triplet superconducting order
parameter to mediate such ferromagnetism. We further perform non-local lateral
spin valve measurements to confirm the origin of the ferromagnetism. The
observation of Hanle precession signals show spin diffusion length up to
micrometres below Tc, demonstrating an intrinsic spin-triplet nature in
superconducting NbSe$_2$. Our discovery of superconductivity-mediated
ferromagnetism opens the door to an alternative design of ferromagnetic
superconductors
