LONDON, March 29 (Reuters) - Spain's markets and competition regulator ordered Madrilena Red de Gas (MRG) on Wednesday to recoup 101.2 million euros transferred to its parent in breach of local rules. The Spanish National Commission on Markets and Competition (CNMC) said MRG had in 2019 extended a 1 billion euro loan to its immediate parent Elisandra Spain V, which would periodically draw down the loan to pay its ultimate owners a dividend.

Spain banned the practice in May 2021, but MRG continued to transfer money, contravening the rules, the regulator said.

Reuters first reported in January that the CNMC was reviewing whether MRG had complied with legislation designed to protect the capital position of critical energy companies.

"The CNMC requests that Madrilena Red de Gas take the necessary measures to return these amounts and position itself within the law," said the regulator, giving it three months to do so.

A spokesperson for MRG declined to comment.

Spain amended existing legislation in spring 2021 to ban regulated gas companies from granting loans, providing guarantees, or guaranteeing loans to related entities that fall outside the natural gas sector or that do not perform central treasury functions.

Elisandra IV is the sole shareholder of Elisandra V. Elisandra IV's main shareholders include Dutch pension fund PGGM and Chinese sovereign fund Ginkgo Tree Investment Ltd., each with a 33.75% stake, as well as the EDF Invest arm of French electric utility EDF with 20%, and the UK's LPPI Infrastructure Investments with 12.5%, according to the company filings. (Reporting by Andres Gonzalez and Pablo Mayo Cerqueiro, editing by Elaine Hardcastle)