It's a balmy fall day at the Helmholtz Gymnasium, and ninth-graders Mara Milbredt and Sasha Konjkav are discussing race relations in California, using Gloria Miklowitz's "The War Between the Classes" as a text. They and their classmates are engaged, the room is neat, the teacher calm.

Just a few blocks away, in a portable school building at the Friedrich Stoltze Hauptschule, students Sercan Icöz and Emilia Popovic are trying to make sense of history class amid the noise of laughter and rowdy behavior.

The differences between these two groups of students, who are about the same age, play out all over Germany. Sasha's parents, engineers who fled the shah's Iran, expect their son to go to university, and his school will enable him to do so. Sercan is the son of Turkish "guest workers," and Emilia's family fled Yugoslavia five years ago. Both families hold low-level jobs. Theirs is a vocational school, and doors to the university are closed, their future plans vague. "Perhaps I'll go to my uncle, who's a hairdresser," says Sercan. The boy learned German by sitting next to a Turkish acquaintance in class.

Germany has for decades taken pride in its education system. And indeed, tracking children as university-bound, middle-school-bound, or trade-bound worked for a time. The system produced the world's Einsteins and Goethes on the one hand, and the most reliable trade people and artisans on the other.

But a new international survey has plunged Germany into intense debate about whether its schools are really addressing the needs of the country's changing population.

In the first study of its kind comparing basic skills of students around the world in reading comprehension, math, and science, Germany placed 25th out of 32 countries. The study, conducted by the Program for International Student Assessment (PISA), a project of the Organization of Economic Cooperation and Development, determined that in no other country does social and ethnic background influence student achievement as much as here. It concluded that Germany's early separation of children by skill level contributes to the problem.

Germans were stunned to learn that 20 percent of their teenagers were almost illiterate, and only in Mexico and the Czech Republic did fewer students go on to higher education. Just 9 percent of German pupils were able to understand complex texts, putting them far behind Britain, with 16 percent, and the United States, with 12 percent.

"We knew before PISA that there is a relationship between social background and performance in all countries," says Petra Stanat, an education researcher at the Max Planck Institute for Human Development in Berlin and coordinator of the international part of the PISA study. "But that that this relationship is strongest in Germany was astonishing."

Early tracking

By age 11 or 12, top students in Germany are headed for high school, or Gymnasium, where they take the Abitur, the high school exit exam that enables them to go on to university. Others go to a less-challenging Realschule, which trains them for white-collar jobs. Less intellectually gifted students are routed toward the Hauptschule to learn trades.

This early division, experts says, may not give children the chance to acquire basic skills before they are separated into the better or weaker school systems.

"That the decision about a child's future comes so early is a real problem for all the children who come to school with language and social deficits," says Gaby Strassburger, a migration researcher at the University of Essen.

"If you track children after fourth or sixth grade, there's little time to bring students of disadvantaged backgrounds up to par with students growing up in more privileged situations," says Ms. Stanat. "It's particularly important to use the time before children are separated very effectively."

But optional kindergarten and short school days, combined with the expectation that mothers should be home in the afternoon to take care of the rest of children's education, place low-income and foreign children at a disadvantage.

Immigrants on the lower tracks

In Frankfurt, immigrants represent 180 cultures and 200 languages. About 35 percent of Frankfurt's pupils are foreign, according to city statistics, but they make up 53.5 percent of Hauptschule attendees and only 21.4 percent of Gymnasium students.

Sercan's school sits in Frankfurt's inner city, where many immigrants settle. At the FriedrichStoltzeHauptschule, only 47 out of 235 pupils are Germans. Like Sercan and Emilia, 80 percent don't hold German citizenship, although they may have been born here. To the children and grandchildren of "guest workers" are added the refugees from trouble spots such as Iraq, Yugoslavia, and Afghanistan.

Little wonder then that school principal Felix Weilbaecher considers himself a youth worker as well as a teacher and school administrator. "I have a lot of work to do before I say, 'I teach math,' " Mr. Weilbaecher says. "We try to do integration work. Where else will integration take place if not in our school?"

Children of refugees land here from around the world, often in the middle of the year. They sometimes come on their own, or their family structure may be unstable. Often, they never properly learn to read and write. The school also takes on students "dumped" from the Realschule because of poor performance.

To Ursula Neumann, a researcher at the University of Hamburg, the fact that Germany has more problems in educating immigrants than other countries is a consequence of its slowness in recognizing itself as a country of immigration.

Germany's first encounter with immigrants after World War II came in the 1950s, with a massive swell of "guest workers" from Turkey, Portugal, Italy, and Greece. For decades, Germans considered the men who built their bridges and factories "one-time migrants" who would go back to their home countries.

It wasn't until recently, when the country eased its citizenship rules and passed its first immigration bill, that Germany started talking about measures to facilitate the integration of immigrants.

"The real problem is that the German school system never adapted to the evolution of society," says Neumann. "That's something we've known for a long time."

Germany's extremely short school days have posed particular problems for immigrant children. For Gymnasium students like Sasha Konjkav, soccer clubs and music schools supplement classtime learning. But Hauptschule pupils like Sercan, whose mothers work or don't speak German, are often stranded after school ends at 1 p.m.

Germany's lowest-track schools, in many cases, are also no longer adapted to the economy, experts say. In the 1980s, blue-collar jobs that had traditionally gone to immigrants dwindled as the service sector grew. And the Hauptschulen were failing to keep pace with new complex skills in many traditional jobs.

Industry demands more knowledge

The Frankfurt airport, Germany's biggest employer, for example, always provided myriad apprenticeships for Hauptschule graduates. This year, though, only five out of about 100 apprenticeships will go to Hauptschule students. More and more, these spots go to students having passed the Abitur. "The economy needs students who are more knowledgeable," says Alexander Pavicevic, who teaches advanced classes at the Friedrich Stoltze. "And that, the school can't offer."

"Today the industry looks at Hauptschule with skepticism," says Elke Waldeeir-Odenthal, a teacher at Frankfurt's Helmholtz Gymnasium. "It demands a certain [amount] of basic knowledge, and more and more they hire trainees from the Gymnasium."

Money is another issue. With 5.5 percent of its GNP devoted to education, Germany ranks near the bottom in education funding, below the US, Sweden, France, and Portugal, according to the Organization of Economic Cooperation and Development. Juergen Kluge, head of the international consulting firm McKinsey & Co. in Germany, estimates it would cost $4.8 billion to put German schools back on track.

Still, the Friedrich Stoltze Hauptschule is trying to address the challenges of a multicultural society, says Eva Maria Blum of Frankfurt's Office for Multicultural Affairs, the only such office in any city in Germany. The school hires teachers with foreign backgrounds, works with city youth centers, and offers classes for immigrants.

Reaching out to immigrant parents

Mr. Pavicevic, who is from Serbia, is one of three teachers of foreign origin at the school, and he works hard to get immigrant parents involved. "I know how rough it is to live abroad and how important it is to speak with parents," Pavicevic says. "I don't let parents find their way to me. I find a way to them."

He has invitations to meetings translated into parents' languages. When he knows the parents don't speak German, he'll find the sister or friend who does. In a pilot program designed with the Office for Multicultural Affairs, Pavicevic uses meetings to inform parents about children's progress as well as the school system and apprenticeship opportunities.

Such efforts, as well as more-formal model programs, are lauded. But widespread change won't be easy. For one thing, education is a state responsibility. In addition, there are wide academic disparities among regions, with southern states like Bavaria performing far better than northern states like Berlin. German Chancellor Gerhard Schröder, a Social Democrat, has pledged $4 billion toward school improvement by 2007. But the conservative Christian Democratic Union maintains that children need free afternoons to study.

Still, the country's education ministers have started improving kindergarten and elementary programs so they better prepare all children for middle school. And they are establishing national standards for each of the three school systems. As of next year, the state of Hessen, where Frankfurt sits, will require foreign children to take a language test before entering primary school. If they fail, they'll have to take special language classes.

Some observers say it is a good that the survey brought out these issues. "The nice thing about PISA is that it comes again," says Stanat. The next survey will be in 2003. "You just can't sit back and hope the problem is going to go away."