More than £3m will be made available to train an additional 371 teachers in the next financial year.

The increase in places at Scotland's university teaching courses will take the total intake of those learning to teach to 3861.

It will be a sixth consecutive rise in trainee places.

Despite the total number of teachers rising last year by 253, 12 council areas suffered a decline in numbers.

Since 2007, when the SNP formed its first devolved government, the number of teachers in Scotland has declined by 4130.

Education secretary John Swinney said: "To give all our young people the best opportunity of success, we need to have the right number of skilled teachers in our schools.

"That is why we worked with local authorities to increase teacher numbers this year, with an additional 253 teachers in Scottish classrooms, and are upping student places for the sixth consecutive year.

"We know our student teacher targets are stretching which is why we are supporting universities to meet them through our new teacher recruitment campaign and £1m from the Scottish attainment fund to develop new routes into the profession."

He added: "I recognise that some councils have faced challenges with teacher recruitment.

"Today's announcement is a further demonstration of the action this government is taking to help them attract more people into teaching and widen the pool of available talent."

The SNP's record on education came in for criticism by Scottish Labour.

The party's education spokesman Iain Gray said: "This is a welcome announcement but it doesn't begin to address the consequences of the SNP's decade of underfunding education.

"Figures released this week revealed a fall of nearly 15%in newly qualified primary teachers. There are 4000 fewer teachers since the SNP came into office and 1000 fewer support staff in our classrooms and a recruitment crisis in key subjects like maths and physics.

"The SNP-Green budget means that nationalists will have cut £1.5bn from councils since 2011. Schools are still struggling to deal with the problems John Swinney created with his own cuts when he was in charge of Scotland's public spending."