## 5 Conclusions  
This study demonstrates the critical role that HESs can play in rural communities by simultaneously enhancing reliability, economic performance, and environmental sustainability. Focusing on the semi-remote area of Aras de los Olmos in Spain--where frequent power outages persist despite grid connectivity--this work evaluates two scenarios using HOMER software to integrate renewable energy sources, biogas generation, and grid energy. In Scenario I, the system optimization prioritized minimizing costs through solar PV (providing 16% of total electricity) and the main grid (84.1%). By strategically adding PV, the overall NPC was reduced by approximately USD 90,000 compared to the existing setup without compromising reliability. Although the grid still dominated the supply, the partial shift toward renewables lowered operational expenses and curbed fossil fuel consumption. In Scenario II, a biogas generator fueled by locally sourced livestock waste was introduced to reduce grid dependency and boost energy autonomy. This approach yielded 55.8% of total electricity from BG, cutting grid reliance to 28.6%--a 55.5% drop relative to Scenario I. Despite incurring an additional USD 1.66 million in total costs, the scenario delivered enhanced reliability, fewer power outages, and significant social and environmental co-benefits. Additionally, Scenario II achieved substantial emissions reductions compared to its base system, with major pollutants decreasing by about 30%, signifying cleaner combustion and reduced fossil fuel reliance. While carbon monoxide remained largely unchanged, these improvements boost air quality, support regulatory compliance, and may yield economic benefits such as lower carbon taxation and enhanced public health outcomes. Nevertheless, realizing these environmental benefits relies heavily on appropriate system management practices, as unmanaged methane emissions from biogas systems can negate emission reduction advantages. Despite these promising results, future studies could improve HESs by addressing several aspects. Advanced energy storage technologies, such as lithium-ion or redox flow batteries, and regionally suitable pumped hydro storage systems could significantly enhance system flexibility and seasonal reliability. Furthermore, a detailed analysis of demand-side management strategies, real-time energy management systems, and consideration of input data uncertainties would strengthen the proposed solutions' robustness and economic feasibility. Additionally, conducting a life-cycle assessment could provide deeper insights into the environmental sustainability of the proposed configurations. These findings underscore the importance of tailored hybrid solutions--leveraging local resources such as solar irradiance and biomass--to bridge the gap between existing infrastructure limitations and a sustainable, secure energy future. Rural communities can balance upfront investments in renewables with long-term operational savings. This approach significantly mitigates reliance on conventional energy sources. Additionally, it stabilizes the power supply and supports broader economic and environmental objectives. Ultimately, this study highlights that hybrid systems, supported by careful optimization and future methodological enhancements, represent a viable and scalable approach to addressing energy challenges in rural and semi-remote regions. Conceptualization, C.R.-B. ; data curation, C.R.-B., C.R.-P. and D.D.-C.; formal analysis, P.M.; funding acquisition, C.R.-P.; investigation, P.M.; methodology, P.M.; project administration, G.E.-E.; resources, G.E.-E. and D.D.-C.; software, P.M.; supervision, C.R.-P. and G.E.-E.; validation, C.R.-B., C.R.-P. and G.E.-E.; writing--original draft, P.M.; writing--review and editing, C.R.-B. and G.E.-E. All authors have read and agreed to the published version of the manuscript. This project received funding from the European Union's Horizon 2020 research and innovation program under grant agreement No.