MADRID, July 10 (Reuters) - Spanish gas grid operator Enagas said on Wednesday it has agreed to sell its 30.2% stake in U.S. energy infrastructure company Tallgrass Energy to U.S. investment firm Blackstone for $1.1 billion.

Enagas will use the proceeds of the sale to finance green hydrogen projects, the company said in a statement.

The transaction, which is expected to close by the end of this month, will bring Enagas a 360 million euro ($389.38 million) capital gain, the company said.

The company - in which the Spanish state owns a 5% stake - is looking to transition from its traditional role as natural gas grid operator to managing a network of hydrogen infrastructure, taking advantage of the Spanish government's ambitious plans to develop green hydrogen production infrastructure. ($1 = 0.9246 euros) (Reporting by Inti Landauro; Editing by Muralikumar Anantharaman)