Image copyright EPA Image caption Students in Ho Chi Minh City mark the 40th anniversary of the end of the Vietnam War

Vietnam's performance in the last international Pisa tests was a stunning achievement.

Participating in the tests for the first time, the country's 15-year-olds scored higher in reading, maths and science than many developed countries, including the United States and the United Kingdom.

It was an achievement that was as much of a surprise for Vietnamese officials as for outside observers.

So how did Vietnam do so well?

There are three key factors that contributed to these impressive results: committed leadership, a focused curriculum, and investment in teachers.

High spending levels

People at the highest levels of government in Vietnam are thinking about the challenges they face in educating their young. Very few other countries have shown a similar level of forward thinking and determination.

Image copyright EPA Image caption Vietnam invests 21% of government spending on education, higher than any OECD country

The education ministry has designed a long-term plan. It is eager to learn from the best-performing countries on how to implement that plan successfully and is ready to commit the financial support that is needed.

Almost 21% of all government expenditure in 2010 was devoted to education - a larger proportion than seen in any OECD country.

The nation's educators have also designed a curriculum that focuses on pupils gaining a deep understanding of core concepts and mastery of core skills.

More stories from the BBC's Knowledge economy series looking at education from a global perspective and how to get in touch

Contrast that with the mile-wide but inch-deep curriculums that you find in much of Europe and North America and you understand why so many of these Vietnamese students excel.

Not just rote learning

These students are expected to leave education not just able to recite what they have learned in class, but to apply those concepts and practices in unfamiliar contexts.

In Vietnamese classrooms there is an impressive level of rigour, with teachers challenging students with demanding questions. The teachers focus on teaching a few things well and with a great sense of coherence that helps students to progress.

Image copyright Reuters Image caption Vietnam has still to find a way to create jobs for those with modern skills

Teachers in Vietnam are highly respected, both in society as well as in their classrooms. That may be a cultural trait, but it also reflects the role that teachers are given in the education system, which extends well beyond delivering lessons in school and embraces many dimensions of student well-being and support.

Teachers are expected to invest in their own professional development and that of their colleagues, and they work with a high degree of professional autonomy.

Vietnam and the US in international tests

Vietnam first entered Pisa tests in 2012 - coming 17th in maths, 8th in science, 19th in reading - higher than the US in all subjects, which was ranked 36th at maths, 28th at science, 23rd at reading.

In global rankings published by the OECD in May 2015, based on science and maths, Vietnam was ranked 12th, while the US was in joint 28th.

In fact, mathematics teachers, especially those working in disadvantaged schools, receive more professional development than the average in OECD countries.

Pupils out of school

These teachers know how to create a positive learning environment, foster good discipline in the classroom, and help to build students' positive attitudes towards learning.

This is also helped by the encouragement of parents, who generally hold high expectations for their children, and by a society that values education and hard work.

What Vietnam has achieved in education in so short a time is remarkable.

But some 37% of Vietnamese 15-year-olds are not in school and the challenge now is to get them enrolled. And the test results, based on those who are in classrooms and learning, say nothing about those young people who are not in school at all.

The government has made it a priority to get all young people into education and so far the education system has been good at absorbing disadvantaged children and giving them equal access to education.

Almost 17% of Vietnam's poorest 15-year-old students are among the 25% top-performing students across all countries and economies that participate in the Pisa tests.

By comparison the average across OECD countries is that only 6% of disadvantaged students are considered "resilient" by this measure.

Making use of skills

But achieving and maintaining quality is harder than expanding quantity, and Vietnam will have to be careful not to let the quality of its education suffer as it broadens access to more children.

Image copyright AP Image caption Rising after war: An attack on Viet Cong forces in March 1965

As the highest-performing countries show, excellence is generally associated with giving individual schools greater autonomy in curriculum and tests, particularly when there are strong accountability measures in place.

For Vietnam this will mean finding a way to balance a centralised leadership with a flexible, autonomous environment for individual schools.

To fully reap the returns of investing in education, Vietnam has to change not only the supply of its skills, but the demand for those skills as well.

As a recent report suggests, Vietnam stands to gain three times its current GDP by 2095 if all of its children were enrolled in secondary school and they all acquired at least basic skills in mathematics and science by 2030 - and if the country's labour market were able to absorb and use all of that talent.

If Vietnam does not create a demand for higher skills, then well-educated Vietnamese may choose to take their skills elsewhere.

Liberalising the country's labour market must be considered at the same time as the country works to build a more highly skilled labour force.

It's a lot to ask of a country and a people, but Vietnam has already shown that it is up to the challenge and, most important, willing and eager to accept and meet that challenge.