It is regulated in arts. 293 et seq. of the LEC (Spanish Civil Procedural Law) and its justification lies in the fact that on certain occasions it is not possible to wait for the trial phase to practice the evidence, since given the generalized delay of our Courts of Law it is common for the hearings to be held even years after the claims have been filed.
In these cases and prior to the presentation of the claim, in the case of the plaintiff, or any of the parties during the course of the procedure due to similar circumstances, the Court may request the anticipated practice of an act of evidence when there is a well-founded fear of that, because of the people or the state of things, such acts cannot be carried out at the generally foreseen procedural moment.
The petition will be addressed to the Court that is considered competent for the main matter, which will monitor ex officio its jurisdiction and objective competence, as well as the territorial one that is based on imperative norms, without the declination being admissible and if the process has already begun, the request for evidence in advance will be directed to the Court that is knowing the matter.
Of course, it will be necessary to justify to the Judge that it is an extreme case (for example, the serious illness of a witness and that this witness is important (that is, not one out of ten), the moving to a distant country, etc.