Keir Starmer has said he will not repeat mistakes which "decimated" coal mining communities in the 1980s when his government phases out new oil and gas drilling.
The Labour leader was told by a delegate at the GMB conference in Brighton that Labour's plan to stop licensing new fossil fuels "a threat to Scottish jobs and UK energy security".
But Sir Keir has been urged to "stand firm" by environmental groups who say the policy is crucial to fighting climate change.
Taking questions from union delegates the Labour leader was asked what he would tell workers when “oil and gas jobs evaporate” and communities were “decimated”.
Sir Keir said he understood concerns and that Britain needed "seize the next generation of jobs in new nuclear, in renewables across the country" and plan for replacement jobs.
"What I will never let happen is a repeat of what happened in coal mining. Where an industry came to an end and nobody had planned for the future, and we're still living with the consequences. We cannot allow that to happen," he said.
Sir Keir said there was a "race on" between different economic blocs like the United States and EU and that "we need to be in that race".
Creating a publicly owner power generation company and changing public procurement rules would help the government intervene effectively, he said.
"We're going to seize that opportunity to get those jobs in renewables and I have estimated there's hundreds of thousands of jobs to be had: 50,000 in Scotland," he said.
"Because we don't want to repeat the error of saying you've got to move you've got to go, we don't need to come to you to your community, you can we can let you whither. We will never repeat that.
"If we don't seize that opportunity, if we just sit back and wait without acting now on our Green Prosperity plan, then I genuinely think that future generations will never forgive us for repeating the mistake that was made when the coal mines were closed down."
UK news in pictures
Show all 50Climate scientists, the International Energy Agency, and the UN Secretary General say phasing out new oil and gas drilling is crucial to meet the objective of the Paris Agreement to limit the global average temperature increase to 1.5°C.
Labour has said it would not issue new licences for exploration of new fields. The policy has drawn criticism from some trade unions which represent fossil fuel workers – but has been welcomed by others.
Philip Evans, Greenpeace UK’s climate campaigner, said: “Our message to Keir Starmer is to stand firm. The evidence is clear, new oil and gas would be catastrophic for the climate. And the fact is we need an energy system fit for the future. Labour’s policy is a crucial step towards this.
“Experts are clear that we already have more than enough oil to see us through the transition to net zero, the need to end new oil and gas production is a completely mainstream view.
“With the right support, job creation in clean energy industries would far exceed the number of old fossil fuel jobs. This would be a huge win for the economy and the planet. We just need politicians with the will to do it.”