MADRID, Aug 3 (Reuters) - Spain’s Gas Natural said on Thursday it had agreed to sell 20 percent of its Spanish gas distribution assets to a consortium of foreign investors for 1.5 billion euros ($1.8 billion).

The minority stake in the Spanish gas business was sold to Allianz Capital Partners and Canada Pension Plan Investment Board.

Gas Natural had been studying a sale of its grid for some time as a result of growing investor interest in similar stakes in recent years.

Proceeds from the sale will be used to back investment in existing projects while any surplus would be used for future investments, optimising debt or remunerating shareholders, Gas Natural said in a statement.

The sale price implies an enterprise value for the Spanish gas business, in which Gas Natural retains 80 percent, of 13.935 billion euros, the company said.

Gas Natural hopes the transaction will be completed by January 31, 2018 at the latest. (Reporting by Sam Edwards; Editing by Adrian Croft)