  (ABRIDGED)
  CONTEXT: The Villafranca project is combining Gaia data with ground-based
surveys to analyze Galactic stellar groups with OB stars.
  AIMS: We want to analyze Stock 18 within the Villafranca project, a very
young stellar cluster with a symmetrical and compact H II region around it.
  METHODS: We analyze the core, massive-star population, extinction, distance,
membership, internal dynamics, density profile, age, IMF, total mass, stellar
variability, and Galactic location of Stock 18 with Gaia data and ground-based
spectroscopy.
  RESULTS: Stock 18 is a very young (~1.0 Ma) cluster located at a distance of
2.91+-0.10 kpc dominated by the GLS 13 370 system, whose primary is an O9 V
star. We propose that Stock 18 was in a very compact state (~0.1 pc) about 1.0
Ma ago and that most massive stars were ejected at that time without
significantly affecting the less massive stars as a result of multi-body
dynamical interactions. Given its age close to 1.0 Ma, the dynamical
interactions took place very soon after massive star formation. Well defined
expanding stellar clusters have been observed before but none as young as this
one. The IMF is top heavy but if we discard the ejected ones it becomes nearly
canonical. Therefore, this is another example in addition to the one we
previously found (the Bermuda cluster) of (a) a very young cluster with an
already evolved PDMF (b) that has significantly contributed to the future
population of free-floating compact objects. If confirmed in more clusters, the
number of such compact objects may be higher in the Milky Way than previously
thought. Stock 18 has a variable extinction with an average value of R_5495
higher than the canonical one of 3.1. The cluster is above our Galactic
mid-plane and has a distinct motion with respect to its surrounding old
population, which is possibly an influence of the Perseus spiral arm.
