Theresa May has said that the thousands of young people who protested against climate change on Friday increased teachers’ workloads and wasted lesson time.

The prime minister said it was good that pupils are politically “engaged” but argued that they need to be in school to become the future professionals who can help solve climate change.

The comments created an immediate dividing line with Jeremy Corbyn, whose name some pupils could be heard chanting, with the Labour leader saying it was “inspiring to see them making their voice heard”.

Schoolchildren joining with the Youth Strike 4 Climate movement walked out of class across the country to demand immediate action.

Organisers said “strikes” took place in 60 towns and cities, with youngsters carrying banners bearing slogans saying “there is no planet B”.

In response to the walkouts, Ms May’s spokesperson said: “Everybody wants young people to be engaged in the issues that affect them most, so that we can build a brighter future for all of us.

“But it is important to emphasise that disruption increases teachers’ workloads and wastes lesson time that teachers have carefully prepared for.

“That time is crucial for young people, precisely so they can develop into the top scientists, engineers and advocates we need to help tackle this problem.”

Children gathered outside parliament, in Cambridge, Brighton and other towns, often dressed in school uniforms and chanting “save our planet” and “now, climate justice”.

Mr Corbyn wrote on Twitter: “Climate change is the greatest threat that we all face but it is the school kids of today whose futures are most on the line.