The European Union has agreed to extend a price cap set on natural gas used for power generation in Spain and Portugal until December 31, a spokesperson for the Spanish Energy Ministry said on Tuesday.

"The agreement enables the extension of this temporary mechanism that will cap the gas price at an average of 55 euros ($59.48) per megawatt-hour to 65 euros per megawatt-hour at the end of this extension," the spokesperson said.

Spain and Portugal imposed the price cap last year in a bid to limit electricity price increases.

The governments pay the difference in the gas market price.

($1 = 0.9246 euros) (Reporting by Inti Landauro and Belen Carreño, editing by Aislinn Laing and Jason Neely)