Teachers yesterday said pupils across Scotland face a "postcode lottery" on the size of classes for English and mathematics in the first two years of secondary.

The warning came as new figures show that although average class sizes across Scotland in the two subjects in S1 and S2 have fallen to less than 19, there are wide regional variations.

Government statistics show 37% of S1 and S2 pupils are still being taught in maths classes of more than 20, with 21% in English classes.

Reducing class sizes to an average of 20 in English and maths was a priority for the previous Scottish Executive, led by Labour and the Liberal Democrats.

Reducing class sizes was also forced on to the political agenda by the Educational Institute of Scotland (EIS), Scotland's largest teaching union, which threatened strike action unless all classes in all subjects are reduced to 20.

Yesterday, Ronnie Smith, general-secretary of the EIS, said the new figures showed that progress had been made, but warned there was still "much to be done".

He also questioned if the SNP's commitment to move towards new class size targets of 18 in the first three years of primary would be delivered if left to local authorities.

"In some parts of Scotland, there are still many hundreds of children being taught in English and maths classes of more than 20 pupils in early secondary," said Mr Smith.

"This is a clear sign that some local authorities are failing to drive down class sizes. We need clear national guidelines on class sizes, which all local authorities must be compelled to meet."

However, headteachers said forcing schools to comply with targets was not the answer.

Bill McGregor, general-secretary of the Headteachers' Association of Scotland, said: "In an ideal world these targets would be met uniformly, but we have to be practical. Individual schools should work towards the targets at their own pace."

The fact that the former government's targets in S1 and S2 had not been met prompted an angry reaction from the SNP, who have themselves been lambasted for appearing to backtrack over their manifesto pledges on class sizes by allowing councils to proceed at their own pace.

"Labour and the Liberal Democrats made a commitment to cut class sizes and spectacularly failed to meet all of their targets. They have broken their promises to the people of Scotland," said an SNP spokeswoman.

Rhona Brankin, education spokeswoman for Scottish Labour, said the SNP would not be able to meet its own commitments.

"With no new money and no expectation from the Education Secretary that class sizes will have to be delivered by every local authority, it's clear that the SNP's manifesto commitment to reduce class sizes is undeliverable."