We empirically evaluate the impact of an sudden and unexpected increase in Swedish electricity prices in the 2000s on the imports of intermediate inputs by Swedish manufacturers. We find that imports declined as domestic electricity prices rose for firms with the most electricity-intense in-house production. We rationalize these findings by developing a simple model of trade in intermediate inputs, which illustrates that energy-intense firms may decrease imports if it is sufficiently difficult to substitute between domestic- and foreign-sourced inputs as domestic energy prices rise. The offshoring mechanism which we identify can help to reconcile conflicting empirical results in the carbon leakage and pollution haven literature, and also has implications for determining the extent to which energy intense trade-exposed sectors should be exempt from domestic climate change policy.