Congress and the White House reached a compromise yesterday on consolidation in the television industry, averting a threatened presidential veto of a measure that would have rolled back a decision by the Federal Communications Commission to loosen the rules.

In June, the FCC relaxed a number of media ownership regulations, among them one that would allow television networks to buy more stations, expanding a network's potential national audience from 35 percent of all viewers to 45 percent.

Last night, congressional negotiators agreed to a 39 percent cap. In real terms, this means ABC and NBC will be able to buy a few more television stations. CBS and Fox, already reaching about 39 percent of the national audience, will not.

The compromise ends one part of a five-month battle begun this summer, when the FCC passed the new media ownership rules. In September, a federal court issued a stay preventing the new rules from going into effect, saying they could harm the public interest. The FCC is arguing that the stay should be lifted.

Many members of Congress and advocacy groups opposed raising what's known as the national ownership cap, saying it would give networks too much power over local programming. Sen. Ted Stevens (R-Alaska) added a rider to an omnibus spending bill that would effectively set the national cap at 35 percent by budgeting no money to the FCC to implement the new cap.

The White House had promised to veto any legislation with language rolling back the FCC rules, which were steered to passage by Michael K. Powell, the Republican FCC chairman. But Stevens refused to remove his amendment; in July, the House passed a spending bill that included similar language to Stevens's rider.

The logjam was broken yesterday evening, when congressional and White House negotiators agreed on a 39 percent cap that would be set in law. Powell and others have argued that there may be no legal justification for setting any ownership cap. Indeed, yesterday's compromise may be overturned by courts as other FCC media rules have been.

Of the four major networks, Viacom-owned CBS and News Corp.-owned Fox each own groups of stations that reach about 39 percent of the national audience. They had hoped to add more stations under the 45 percent cap. As a result, they are on the losing end of yesterday's deal. On the other hand, if the cap had been returned to 35 percent, CBS and Fox could have been forced to sell stations.

"This is a backroom deal to let the two largest networks keep all of their stations," said Gene Kimmelman, public policy director for Consumers Union, which opposed the new media rules.

NBC, owned by General Electric Co., owns stations reaching about 35 percent of the national audience and has room to grow. ABC, owned by the Walt Disney Co., has the smallest group of stations, reaching only about 25 percent of the national audience. The company was a virtual non-player in lobbying efforts designed at raising the cap.

Yesterday's deal addressed only one of the new FCC rules. A separate rule allows one company to own the top-rated television station and biggest newspaper in most cities, while another allows one company to own two television stations in many cities and three in the largest cities. Advocacy groups and some lawmakers have vowed to try to overturn the other rules, as well, in next year's Congress.

Sen. Ted Stevens (R-Alaska) had stood firm on a rider to a spending bill that effectively set TV networks' ownership cap at 35 percent of the U.S. audience.