The city of Thebes, in central Greece, has often been marginalized if not forgotten, both in antiquity and in modern times. Though it produced at least one wonderful poet (Pindar) and one stellar musician (Pronomus), it never bred a historian to match, say, Thucydides of Athens. Its mythical tradition was appropriated by the dramatists, above all the tragedians, of Athens, and the tradition itself is riddled with filicide, patricide, incest, civil war and other such abominations. But it was in 480 B.C. that Thebes blotted its escutcheon comprehensively: So far from joining forces with Sparta and Athens to resist a mighty Persian amphibious invasion, it actively took the Persian side and, to use a word derived from the Greek for such an act, “medized.” For that error, Alexander of Macedon made the city pay horribly, annihilating almost all of it in 335 B.C.

In “The Sacred Band,” James Romm brings to the fore another striking aspect of Thebes’ varied history: a group of warriors who originated there and who, over four decades in the fourth century B.C., fought throughout central Greece, helping to defeat formidable foes and solidifying Thebes’ decade-long dominance. Mr. Romm, a classics professor at Bard College, deftly pieces the story together from the limited sources that have come down to us.

It is not entirely clear, for instance, why the lokhos (i.e., regiment or band) was dubbed hieros (or sacred), though it is logical to guess that it was because its 300 members swore a religious oath of mutual loyalty in the names of the Theban gods. (Among those gods was the native son Heracles, a role model in more ways than one.) Nor do the sources tell us precisely how the first 300 were recruited—apparently by one Gorgidas, in 378 B.C.—or how the total of 300 was maintained when any member of the Sacred Band, always supposedly one of an adult loving couple, was killed or incapacitated. The figure of 300, by contrast, is relatively easy to account for: Other Greek cities had maintained elite forces of that size. Probably the most famous 300 of all—before the Sacred Band—was the elite pick-up force of Spartans gathered by King Leonidas for the anti-Persian defense of the Thermopylae pass in 480 B.C.

The period of the Sacred Band’s 40-year history—378-38 B.C.—is a tangled web of shifting alliances and affiliations, especially during Thebes’ heyday, ending in 362 B.C. At the time, Thebes was one of the major players in mainland Greece and the hegemon of all Greece, from Macedonia southward, calling the shots thanks to its remarkable military distinction. That distinction was owed not least (but not exclusively) to the Sacred Band.

Among the pleasures of Mr. Romm’s account are the remarkable figures who emerge from the military derring-do. The Sacred Band’s most prominent commander was Pelopidas, a man of democratic leanings who had masterminded a bold and cunning coup against Sparta’s brutal occupation of Thebes just before the band was formed.

Perhaps the single most influential Theban of all during the Sacred Band’s early years was Epaminondas, a philosopher as well as a military strategist and diplomat of genius. He commanded the army that defeated the Spartans in 371 B.C. at the Battle of Leuctra. This was the Sacred Band’s finest hour, when its special qualities—esprit de corps, elite training, courage and efficiency—were brilliantly integrated by Epaminondas into his unorthodox tactics. Some of Sparta’s allies were not even displeased by the battle’s outcome, as the Athenian historian Xenophon, usually pro-Spartan, did not scruple to record. Epaminondas also defeated the Spartans, together with the Athenians, in 362 B.C. at the Battle of Mantinea in Arcadia, where the Sacred Band also played a decisive role. In that battle—Greece’s Trafalgar, ending Sparta’s military pre-eminence forever—Epaminondas was fatally wounded, and buried nearby, together with his adult male lover.

It is to Xenophon, always a stickler for precise vocabulary, that we owe one precious piece of information on the nature of homoeroticism at Thebes. What the Greeks called paiderastia—not our “pederasty” but the love or erotic desire of an adult male warrior-citizen for an adolescent juvenile—was widespread in the Greek world, but the Thebans practiced a male-male homophilia significantly different from, say, that of Sparta. In Thebes, it was not unusual, Xenophon implies, for adult males to live together as if in a relation of marriage (suzugentes). That is surely why Gorgidas (putatively) could conceive his newfangled idea of a crack force of sworn lovers and have it put into effect so successfully.

All of this Mr. Romm negotiates artfully in fluent, accessible prose. But he really comes into his own when describing the Sacred Band’s dramatic and elegiac end. In 340 B.C., a now moderately democratic Thebes agreed to resist jointly with Athens the encroachment of Philip II of Macedon, whom both states regarded as an autocrat if not a tyrant. But Philip held all the cards. His enemies were routed, and in 338 B.C. the Sacred Band seems to have died to a man at Chaeronea—like Thebes, a city in the central Greek region of Boeotia. In past battles, Mr. Romm writes, “the Sacred Band had charged on the run, smashing at speed into the enemy line.” This time, though, they were cut off from flanking troops and left exposed. Philip’s son, the young Alexander, “carved away at the Band, stripping off layer after layer.” The clash “that decided the freedom of Greece was over by midday.”

Mr. Romm quotes an earlier Theban commander, Pammenes, having remarked that soldiers such as those of the Sacred Band “out of love for their eromenoi [beloveds] or shame before their erastai [lovers] . . . would stand fast against dangers for one another’s sake.” And so it proved to be. “The Sacred Band” includes a collation of drawings made in the 19th century that show, in ghostly outline, the disposition of some 254 skeletal corpses in a cemetery at Chaeronea—the recovered remains of the Sacred Band. They are joined in death as in life, some hooked together at the elbow while others are holding hands.

Mr. Cartledge, a senior research fellow at Clare College, Cambridge, is the author of “Thebes: The Forgotten City of Ancient Greece.”