The 2021-2022 high pathogenicity avian influenza (HPAI) epizootic was the worst ever recorded in Europe in general and in Spain in particular. Between December 2021 and November 2022, H5N1 clade 2.3.4.4b HPAI viruses caused outbreaks in both wild birds and domestic poultry in Spain. We analyzed the complete genome sequences of H5N1 HPAI viruses identified during this period in Spain and conducted comparative phylogenetic analyses to identify their origin and reconstruct their evolutionary and diffusion dynamics. We identified four different genetic reassortants of H5N1 clade 2.3.4.4b HPAI viruses. Our results suggest multiple wild bird introductions of H5N1 clade 2.3.4.4b HPAI viruses into different regions of Spain from other European countries. Bayesian phylodynamic analyses of H5N1 clade 2.3.4.4b HPAI viruses support that their initial entry into Spain occurred in the North-West and South-West through wild birds, which further spread the viruses to other regions within Spain. Andalusia (South) was the hotspot for maintenance of viruses in poultry. Wild Anseriformes played a crucial role in the introduction of the viruses into Spain and the subsequent transmission of these viruses to other host types of birds, both wild and domestic. This study highlights the role of wild birds in the ecology of H5N1 clade 2.3.4.4b HPAI viruses and provides further insight into the genetic diversity, evolution, and spread of these viruses between wild birds and poultry.