Shell said it would pay $4.4 billion in cash and assume $1.8 billion in Repsol debt and other obligations.
The deal also includes a gas-fueled power plant in Spain.
For Shell, Europe's largest oil company, the deal builds on an already strong specialization in LNG. More than half of Shell's production comes from natural gas, rather than oil, and it has stakes in LNG facilities across the world.
Repsol said separately it would book a $3.5 billion gain on the deal and significantly strengthen its balance sheet, cutting net debt by half to around
euro2.2 billion ($2.9 billion).