There may not be a simple secret to improving public schools but, if there is a formula, then the Brazilian city of Sobral might lay claim to it.

Located in the historically poorer north-east of the country, the municipality of 210,000 residents once had middling learning outcomes. An assessment of third-grade students (aged eight) there two decades ago found that two out of five could not read a simple word.

The district in the semi-arid interior of Ceará state did not make it into the top 1,000 of about 5,500 local authorities in a national index measuring quality of education, in 2005. Yet, just over a decade later, Sobral topped the rankings for both early and final years. It has achieved scores higher than the average of private schools in the wealthier state of São Paulo.

Behind the advances is a transformation of the schooling system that began in the 1990s and is celebrated as an exemplar by international education experts.

“Sobral managed to overcome the challenges despite having limited resources,” says Francisco Herbert Lima Vasconcelos, the city’s education secretary. “We established a plan, we set clear goals, we made a monitoring system that follows, through evaluations, the learning of each class [and] student.”

With a strong focus on early-years literacy — underpinned by the goal of ensuring every child can read and write by the end of second grade (aged seven) — the model involves regular pupil assessments and incentives for teachers, as well as continued professional training.

An important plank was ending political appointments of school and management roles. Staff were hired on merit and technical abilities, with bonuses tied to performance. City spending increased and monitoring and support of absentee students helped virtually eliminate dropouts, according to a World Bank study last year.

Samyla Nascimento de Sousa, who teaches six-year-olds at the José Ermírio de Moraes school, says structured routines are planned by teams including a teacher, co-ordinator and manager. She sums up the ethos of constant improvement: “If the class is going badly, we need to restructure it. If it is working well, what can we do better still?”

“The teachers always motivate us to keep chasing, to have that spirit of trying to improve our marks,” says 13-year-old Diogo Araújo Frota Neto, who is thinking of studying programming or engineering once he leaves Trajano de Medeiros school in Sobral.

If the principles sound basic, they should not be taken for granted in Brazil, where improving state education is one of the biggest challenges for a government seeking to restore competitiveness to Latin America’s biggest economy.

Brazilian students who sat Programme for International Student Assessment (Pisa) tests in 2018 scored lower than the OECD average in reading, mathematics and science, showing stagnation in those subjects since 2009.

Proponents of the experiment in Sobral say it offers a blueprint for lifting standards throughout the country.

“What Sobral did in education was to implement basic elements that work,” says João Marcelo Borges, a researcher at the Fundação Getulio Vargas private university. “It seems easy, but doing this at scale is not.”

The groundwork was laid by consolidating a network of smaller schools into fewer, larger institutions, according to the World Bank study. This avoided classes of mixed ages, but also involved lay-offs of about one-third of teachers. The infrastructure of schools and meals were improved, with transportation provided for students.

The campaign was expanded across Ceará, which climbed the education tables. Ceará also introduced fiscal incentives, awarding municipalities greater resources based on results.

And, despite investment per student being just one-third of that in São Paulo, Ceará achieved better results, according to Borges — who adds that a “solidarity mechanism” was important. “The municipalities with the best results and schools, to receive the prizes, need to support municipalities and schools with the worst results,” he explains.

Now efforts are under way to roll out the system to other corners of the nation of 210m people. The Lemann Foundation, a non-governmental organisation that works in education, has helped to replicate it in 23 other municipalities since 2018, and plans to add another seven this year.

Camila Pereira, Lemann’s director of education, says that political leadership and support for the changes had been key in Sobral and Ceará. “It’s possible to do a lot with existing resources.”

The Sobral model is not without its critics, however. Luiz Carlos de Freitas, a retired former professor at the University of Campinas, describes it as based on “the mistaken belief that a higher grade in the tests is synonymous with good education. [This results in] a narrowing of the training of students, focusing only on what comes up in tests.”

A federal government literacy programme inspired by Ceará was less successful, in the view of some education experts. Sobral’s ratings also dropped in the most recent nationwide basic education index (in 2019), although it remains top among municipalities of a similar size.

Ceará’s methods have been tested during the pandemic, as well — not least because of socio-economic deprivation in the area. Following schools closures, some families did not have internet access or electronic devices for distance learning.

Samyla Nascimento de Sousa had to print out and deliver activities for pupils. But, after initial difficulties, around half of her class now actively participate in virtual lessons.

“For around 40 per cent of the students, who have to share one mobile phone between two of them, we send activities in the morning and they send them back completed,” she says. “Then I do the corrections — all by WhatsApp.”