Russia's invasion of Ukraine has had significant global economic implications, disrupting trade flows and leading to a rise in oil prices that has affected world economies, including Morocco. The aim of this study is to assess the impact of these external shocks on the Moroccan economy using a dynamic stochastic general equilibrium (DSGE) model, which enables detailed analysis of the interactions between various macroeconomic variables such as inflation, exchange rates and trade balances. The results of the study highlight the importance of taking risk premium shocks into account in economic policy‐making, as they can lead to higher inflation and a real depreciation of the Moroccan currency. The DSGE model provides a sound analytical framework for policy‐makers to assess and manage the impact of these external shocks on the Moroccan economy and thus promote economic stability and growth in the context of global economic uncertainty.