The Victorian Government has secured a deal with Latrobe Valley power companies that will see them give the state five years’ notice if they intend to close.

The deal sees AGL and Energy Australia granted extensions to their mining licences, but forces them to cease operations at the end of the new agreements.

AGL gets an 11-year extension to allow it to mine coal at Loy Yang until the end of 2048, while Energy Australia was granted an extra six years and to mine at Yallourn until the end of 2032.

In exchange, the power companies have agreed to give at least five years' notice of any intention to close.

The Government wanted the assurance to prevent a repeat of the sudden closure of the Hazelwood power station last year, which threw many Latrobe Valley residents into turmoil.

Victoria's Resources Minister, Tim Pallas, welcomed the certainty.

“These extensions support our energy security and provide certainty for workers and communities across Victoria,” he said.

Environmentalists say the deal makes targets to cut greenhouse gases harder to reach.

While AGL and Energy Australia will be forced to cease mining brown coal in 2048 and 2032 respectively, they will maintain control of the mine sites until 2065 and 2051 for rehabilitation.