The classroom at Intermediate School 318 in Williamsburg, Brooklyn, was filled on Tuesday with the thumping and clattering of a half-dozen high-speed chess matches, played with a rambunctious energy more reminiscent of a hockey game than of Garry Kasparov and Deep Blue.

The school’s conquering heroes — its chess players — were blowing off steam. On Sunday, in Minneapolis, they became the first middle school team to win the United States Chess Federation’s national high school championship. The team, mostly eighth graders, beat out top high schools like Stuyvesant in Manhattan and Thomas Jefferson in Alexandria, Va.

The victory burnishes what is already a legend in the chess world. At I.S. 318, more than 60 percent of the students come from families with incomes below the federal poverty level. Yet each stairwell landing bristles with four-foot chess trophies, and the school celebrities are people like James A. Black Jr. A 13-year-old with twinkly eyes and curly eyelashes, James is not a football hero or a valedictorian, but a certified chess master who gently corrects his teachers on the fine points of strategy.

Watching over a particularly raucous game on Tuesday, James, wearing a black sweatsuit and a huge book bag, took notice of the moment when only kings and pawns were left. “Automatic draw,” he declared. “Insufficient mating material.”