Yasmin Dagne is in the eighth grade at Newport Mill Middle School in Kensington, but she and most of her friends are taking 10th-grade math.

More than one-third of Maryland students take at least one high school math course before they leave middle school. Changing philosophies dictate that students should learn math concepts as soon as they are ready, not when the lesson plan says they should.

"There's a class of about 25 kids, and we've all taken algebra together," Yasmin said. At her school, one of the most racially diverse in Montgomery County, algebra participation quadrupled in two years after more students were invited to take the course. "It wasn't as difficult as I thought it would be," Yasmin said.

The rise of advanced math in middle schools goes hand in hand with the dramatic increase in Advanced Placement and International Baccalaureate coursework in high school, each trend feeding the other. School systems are expanding access to courses that typically have been restricted to the academic elite, gambling that students with weaker academic credentials can succeed in the most difficult classes.

The gamble has paid off. Of the 23,979 Maryland middle school students who took the state High School Assessment in algebra last spring, 90 percent passed, according to an analysis of data from the Maryland State Department of Education. Thirty-seven middle schools had a 100 percent pass rate. The overall pass rate on the exam, which is a graduation requirement starting with the Class of 2009, was 54 percent.

It's a striking success story for middle schools, which, in the Washington area and nationwide, have shown anemic progress on some state and national exams in recent years.

At MacArthur Middle School at Fort Meade, in Anne Arundel County, the number of students taking high school algebra has more than doubled since 2003. Participation in the Maryland School Assessment in geometry, which requires knowledge of 10th-grade math, has gone from zero to 46 students. Nearly half of the students taking algebra and geometry at the school are black.

"Geometry is kind of easy. It's mostly thinking," said Wayne Harding, 13, an eighth-grader at MacArthur who wants to become a fighter pilot.

When Eric J. Smith became superintendent of Anne Arundel schools in 2002, students were allowed to take high school math in middle school only if they scored in the 90th percentile or better on a math aptitude test.

Smith relaxed entry rules so that three times as many students -- those scoring in the 70th, 80th or 90th percentiles, as well as some in the 60th percentile -- could take Algebra I in middle school. Less than 5 percent of students who took the state algebra test this spring failed.

In Anne Arundel middle schools, participation in the statewide geometry exam has grown from 45 students in 2002 to 714 this year, a figure surpassed only by much-larger Montgomery. Anne Arundel is home to Severna Park Middle School, which had more students take the state algebra test, 326, than any other middle school last year.

But the pace of math acceleration is uneven and varies from school to school and county to county. In Prince George's County public schools, participation in the state geometry test has declined in the past three years, and less than 15 percent of students take high school algebra in middle school.

In Maryland, the number of students who passed the state geometry exam in middle school, meaning that they had completed two years of high school math, reached 4,246 this year, up from 2,436 in 2002. The analysis does not include a handful of schools that include middle school grades but are not labeled middle schools in the state's database.

In Virginia, the number of seventh- and eighth-graders taking the Standards of Learning exam in geometry rose from 2,928 in the 2000-01 academic year to 4,130 in 2004-05.

What's driving the trend, math educators say, is the same push toward advanced academics that is swelling enrollment in Advanced Placement and International Baccalaureate courses in high schools.

"One factor is the recognition that algebra is the gatekeeper for more advanced math, as well as for science courses," said Mark Johnston, assistant superintendent of the Arlington school system, where the share of students taking Algebra I in middle school rose from 27 percent in the 1999-2000 school year to 48 percent in 2004-05.

Teachers also cite new statewide standards for what students should know at each grade level that introduce algebraic concepts at an earlier age. In Frederick County, for example, the concept of variables is now introduced before the fifth grade.

"Each generation is becoming more and more ready for higher-level thought when they arrive at the middle school level," said Lois Roney, a math specialist at New Market Middle School in Frederick County.

Cathy L. Seeley, president of the National Council of Teachers of Mathematics, said middle schools have made tremendous progress in math instruction since the 1970s, when middle school math "was a review of all the arithmetic that students were supposed to have learned in K through six."

She cites one drawback to accelerated math instruction: a possibility that advanced students could run out of math courses to take in high school.

At MacArthur Middle School, Scott Rassatt, 13, took Algebra I as a sixth-grader, geometry in seventh grade and, this year, Algebra II. He probably will take pre-calculus as a freshman and calculus as a sophomore -- the highest-level math course offered at many schools.

Next year, because of Scott and students like him, the Anne Arundel school system will offer a course in its high schools called Calculus III for students who have taken ordinary calculus and need a fresh challenge.

Staff writer Nick Anderson contributed to this report.

Bridget Stendardi instructs seventh-graders Taylor Sessoms, left, and Brian Mazi in algebra at MacArthur Middle School at Fort Meade, where the number of students taking high school algebra has more than doubled since 2003. MacArthur seventh-grader Mikal Whitlow works on an algebra problem shown on a projector.