A funny thing happened to the FCC Friday on its way to regulating the Internet, as a federal appeals court panel questioned the agency’s authority to regulate the web. There’s no final decision yet, but an adverse ruling could stop the agency’s Internet regulation plans in their tracks. And for good reason.

Last fall, the FCC proposed a set of “open access,” or “net neutrality” rules aimed at controlling how Internet service providers manage their networks. However it faced one rather inconvenient obstacle: there isn’t anything in the Communications Act, or any other statute, actually giving it power to regulate such things. Internet service, by the FCC’s own reckoning, is not a telecommunications service, nor is it cable TV, or broadcasting, or anything else the law give the FCC authority to regulate.

That detail, however, didn’t bother the “yes, we can” rulemakers at the FCC, who asserted that they nevertheless had jurisdiction under a doctrine known as “ancillary jurisdiction.” This court-defined doctrine, itself to be found nowhere in the statute books holds that the Commission can in matters that fall within its general statutory grant of jurisdiction and are “necessary to ensure the achievement of the Commission’s statutory responsibilities.”

It is a remarkable legal theory, allowing a regulatory agency to act in areas where there is no grant of authority, simply because it is related to an area in which authority has been granted. In effect, it is a “horseshoes and hand grenades” doctrine, in which close is good enough to count.

In the past, the doctrine has been used to justify such things as FCC regulation of cable television (back in the days when cable TV was basically an extension of broadcast television). But asserting it to regulate the Internet was a bit of a stretch.

It wasn’t the first time the Commission made that stretch. Last year, the FCC issued a ruling against Comcast, for violation of the then existing policies on network management. Comcast sued, raising the question of FCC jurisdiction. That was the case that was argued before the D.C. circuit court of appeals Friday.

It didn’t go well, as the FCC got an earful. “You have yet to identify a specific statute,” said Judge Raymond Randolph. As the FCC’s lawyers metaphorically searched their pockets for something to cite, Judge David Sentelle added: “You can’t get an unbridled, roving commission to go about doing good.”

An adverse decision would not just negate the Comcast decision, but also derail Commission’s plans to finalize the new, more extensive regulations it formally proposed last October. The action would then move to Congress, which already considering legislation on the matter. That’s bad news for regulation proponents, who had been hoping for a quick win. But its good news for the rule of law and the idea that the power to regulate is nothing like either horsehoes or hand grenades.

Stay tuned.