In a case affecting what television programming Americans receive, the Supreme Court ruled yesterday that cable systems can be forced to carry local broadcast television stations. The 5 to 4 ruling was a big victory for broadcasters that, in the face of increasing cable dominance, are struggling to hold on to their audience.

The decision upholds a federal law requiring cable television operators to carry the signals of local commercial and public broadcast television stations. That law, part of broad 1992 cable legislation, was intended to protect free over-the-air television broadcasting and especially smaller broadcasters that feared cable systems would shut them out completely.

More than 60 percent of American households subscribe to cable, and once they do, their cable-linked sets receive all of their TV programming, even broadcast stations, over that system. Cable companies eagerly carry the big three broadcast networks because of their wide viewership. But smaller broadcasters  such as Channel 20, Channel 50 and Howard University's public television station in Washington  risked being dropped by cable companies without the protection of the federal law. Yesterday's decision ensures that no matter how cable operators configure their lineups, local broadcast stations will get channel space.

Television in the late 1990s is an increasingly competitive business, in which cable companies, broadcasters, satellite TV services and video rental shops compete for the loyalties of American households. Yesterday's decision affirms a key facet of the rules governing that competition, generally to the disadvantage of the $25 billion-per-year cable industry.

Its companies have invested heavily to build the systems that connect to U.S. homes. Larger members of the industry, such as Time Warner Inc., have also bought studios that produce programming. Seeking a return on that spending, cable companies were eager for increased flexibility in deciding what programming goes onto their systems, which have fixed numbers of channels that can be increased only at major cost.

The ruling came as a surprise to the cable industry, which had argued that forcing operators to carry certain broadcasts violated their First Amendment right to free speech. Many cable operators had thought that the "must carry" rule would be struck down and that several channels on their systems would suddenly be available for other programming.

"There are a lot of aspiring programmers out there, and more ideas than there are slots," said Bruce D. Sokler, who represents the Turner Broadcasting System, the cable and movie conglomerate founded by Ted Turner and now owned by Time Warner Inc. Turner had challenged the law immediately after its enactment.

But Bruce J. Ennis, lawyer for the National Association of Broadcasters, which joined the Justice Department in its defense of the law, said: " `Must carry' doesn't hurt the homes with cable at all, because cable is expanding its capacity. . . . If `must carry' had been struck down, broadcast stations would be dropped by cable operators. And once dropped, they would lose advertising revenue and the quality of programming would decline."

The court majority yesterday noted that if cable operators were allowed to stop carrying local broadcasts, broadcasters would not be able to reach most of their potential audience or earn sufficient advertising revenue.

"Congress has an independent interest in preserving a multiplicity of broadcasters to ensure that all households have access to information and entertainment on an equal footing with those who subscribe to cable," Justice Anthony M. Kennedy wrote for the court. He was joined by Chief Justice William H. Rehnquist and Justices John Paul Stevens, David H. Souter and, for the most part, Stephen G. Breyer.

Dissenting justices argued that the federal government failed to produce convincing evidence that the vitality of the broadcast industry depended on the "must carry" regulations.

"Congress has commandeered up to one-third of each cable system's channel capacity for the benefit of local broadcasters, without any regard for whether doing so advances the statute's alleged goals," said Justice Sandra Day O'Connor, joined by Justices Antonin Scalia, Clarence Thomas and Ruth Bader Ginsburg.

The dissenters also suggested that because the federal government was trying to achieve "diverse" and "responsive" programming, it was unconstitutionally trying to regulate the content of speech.

As cable television has grown in recent decades, it has clashed with broadcasters competing for the same viewers and advertisers. When the broadcasters persuaded Congress to pass the "must carry" rules, it argued that cable effectively could control the fate of over-the-air TV stations.

The case of Turner Broadcasting System v. Federal Communications Commission first came to the high court in 1994. The justices ruled then that, because "must carry" did not give a preference to broadcasters based on the content of their programs, it could be assessed under a First Amendment test that required only that the regulation further a substantial governmental interest to be upheld. A federal court in the District then declared the law constitutional.

In yesterday's ruling affirming that decision, Kennedy wrote that in the vast majority of cases, cable operators have been able to satisfy the law using previously unused channels. Kennedy acknowledged that there was little evidence that local broadcasters were going bankrupt. But he said, "Congress is under no obligation to wait until the entire harm occurs but may act to prevent it."

Breyer, the key fifth vote in the case, wrote separately to observe that while the majority emphasized the promotion of fair competition, he supported the statute because it preserves the benefits of free, over-the-air local broadcasts and promotes the widespread dissemination of information.

Time Warner Entertainment Co. and several other cable conglomerates had joined the case. C-SPAN, the cable TV network that provides coverage of Congress, had closely followed the case, saying that it was being bumped off cable systems around the country in favor of local broadcast stations.

"More than 3.5 million viewers have lost access to all or part of the C-SPAN networks since the 'must carry' rule became law in October 1992," C-SPAN Chairman Brian Lamb said after the ruling. "Today, the court has basically guaranteed that the information gap will widen for many more."