In this paper it is considered that the relationship between nominal exchange rate and prices depends on the nature of the shocks impacting the economy. In order to identify the sources of nominal exchange rate and relative price fluctuations we impose long-run restrictions on the dynamics of these variables through a 2-variable and 3-variable SVAR, respectively. This methodology is applied to data on the Spanish economy and find that supply and real demand shocks move nominal exchange rates and relative prices in opposite directions. Nominal shocks, however, move both variables in the same direction. Thus, in this case, only under nominal shocks may exchange rate depreciations fuel inflation.