Graduates who have lost their jobs in the recession are to be offered personalised support to retrain as science teachers in a drive to improve education in secondary schools, Gordon Brown has announced.

The initiative seeks to encourage people with degrees in science, maths or IT who have recently joined the ranks of the unemployed to consider a new career in teaching.

In a speech at Oxford University today, the prime minister said the move would help achieve the government's target of ensuring almost all state schools offer physics, chemistry and biology as separate subjects within the next five years.

At present, fewer than a third of state schools offer "triple science" – the option to learn the three major sciences as separate subjects – although progress has been made since 2005, when only 22% of schools offered all three.

In the speech, Brown acknowledged that mainstream comprehensive schools have suffered from a lack of specialist science teachers able to take single-subject classes and stretch the brightest pupils.

The drive aims to double the number of children taking three science subjects to 17% by 2014, and raise the number of students taking A-level maths from 56,000 to 80,000 over the same period.

Brown used the speech to set out a "national ambition" for Britain to educate "the great scientists of tomorrow" who were "more inspired by those who give to the world than by those who take from it."

The big question facing the nation today was how to make Britain "the best country in the world in which to be a scientist in the months and years to come". He said the answer lay in entrenching investment in science as a "national priority".

The speech received a broad welcome from scientists, who were encouraged by a vow to ring-fence science funding in order to protect research and development budgets from being raided during the downturn.

The government will be hoping the measures are enough to deter British scientists from leaving for the US, where the Obama administration has embraced science and is about to boost research and development funding with an $18bn stimulus package.

"Just maintaining current spending commitments will mean that we are losing ground against countries like the US that are giving science a huge boost within their stimulus packages," said Nick Dusic, director of the Campaign for Science and Engineering in the UK. "The government has got the UK back in the race to be a world leader in science, but unless it keeps pace we will lose talent and investment to other countries that are following up fine words with hard cash."

Beth Taylor at the Institute of Physics said: "We need to be more ambitious in the present climate. We would love to see the UK emulate Barack Obama's science plan for the USA. The US, along with every other G8 country, is going for increased investment in research as a way to address the immediate problems of recession and at the same time create a great basis for new growth when recovery begins. If the UK doesn't join in, there is a real risk that good scientists will start gravitating to the States or elsewhere, and that companies with a strong R&D element will do the same."

Sir Leszek Borysiewicz, chief executive of the Medical Research Council, said: "UK science is a global success story, punching way above its weight not just in terms of the knowledge it produces, but in economic, health and social benefits. Investment in science is vital, not only to sustain the country in a downturn, but to provide the footholds for our recovery in the future."