Spanish inflation has surged to a near 37-year high due to sky-high energy prices following Russia's invasion of Ukraine, official data showed Wednesday, adding pressure to the government.