TODAY, a onetime patent holder on a Spider-Man “web-shooting” toy apparently reached the legal end of his line.

The Supreme Court this morning ruled in favor of Marvel Entertainment over an expiration on patent royalties, and in doing so, turned a legal hand toward toy inventor Stephen Kimble, wrapping up his claims by shooting with its thumb decidely pointed down.

The case’s quick origin story: In 1990, Kimble invented a wristband toy that shot pressurized foam string; Marvel Enterprises purchased the patent and created that Spider-Man fan favorite, the well-selling Web Blaster. The initial deal set no end for royalty payments to Kimble, but then Marvel discovered a case (1964’s oft-criticized Brulotte vs. Thys) nearly as old as Spider-Man himself — one that ended Kimble’s right to royalties in 2010.

Kimble has reportedly made more than $6-million off the patent, but to extend his royalties, his legal fight essentially pivoted on the court acknowledging applicable flaws in Brulotte. (Kimble’s legal team argued that Brulotte “suppresses innovation and interferes with the goals of the patent system.”) The ruling said that Congress may wish to take on Brulotte, but that the Supreme Court cannot.

“Marvel is pleased with the Supreme Court’s decision, which upholds the court’s legal precedent from half-a-century ago,” parent company Disney said in a statement.

Now, with a certain peek-of-the-geek wit, Justice Elena Kagan wrote the 6-3 ruling (with Justice Samuel Alito writing the dissenting opinion). So beyond the might and would-be rightness of the legal decision — and the intellectual soberness of scholarship within — Kimble v. Marvel should be appreciated by Spider-Man fans, too, for the high court’s high sense of comic playfulness. Those references include:

1. A nod both to grownup fanboys and the spirit of costume play. Kagan refers to “a toy that allows children (and young-at-heart adults) to role-play as ‘a spider person’ by shooting webs.”

(And really, who knows the value of costume better than America’s original cosplayers, the black-robed Supremes?)

2. Kagan gets parenthetically playful with a sense of song, writing: “The parties set no end date for royalties, apparently contemplating that they would continue for as long as kids want to imitate Spider-Man (by doing whatever a spider can).”

(We can hear it now, as sampled by Kate McKinnon’s character Ruth Bader “Notorious RBG” Ginsburg, on “SNL’s” Weekend Update.)

3. In summing up the court’s ruling, Kagan actually refers to Spider-Man language from 1962’s Amazing Fantasy No. 15, by co-creators Stan Lee and Steve Ditko, by quoting Peter Parker’s Uncle Ben:

“What we can decide, we can undecide. But stare decisis teaches that we should exercise that authority sparingly. Cf. S. Lee and S. Ditko, Amazing Fantasy No. 15: ‘Spider-Man,’ p. 13 (1962) (‘[I]n this world, with great power there must also come — great responsibility’). Finding many reasons for staying the stare decisis course and no ‘special justification’ for departing from it, we decline Kimble’s invitation to overrule Brulotte.”

(It should be noted, too, that within an easy web-sling of the Supreme Court, the original art from Amazing Fantasy No. 15 lives at the Library of Congress. This town appreciates its Spidey.)

Comic Riffs, of course, had to get an equally playful reaction from Spider-Man’s co-creator himself.

“It’s kinda nice to be quoted by the Supreme Court,” Lee tells The Post’s Comic Riffs this morning. “The next time they meet in session, I hope they remember my cameo.”

Kagan concluded the court’s ruling by writing: “For the reasons stated, the judgment of the Court of Appeals is affirmed.

“It is so ordered.”

Which is essentially her way of writing: “Excelsior!”