TRENTON, N.J. (AP) _ The New Jersey Supreme Court dealt the tobacco industry a major defeat Thursday, ruling that municipalities can ban cigarette vending machines to make it harder for minors to buy cigarettes.

A lawyer for East Brunswick, whose 1990 ban was challenged by four vending machine companies, predicted the decision will encourage other communities to enact similar bans.

''I think it will have a considerable impact'' outside New Jersey, attorney Bertram E. Busch said of the court's 6-0 ruling.

Anti-smoking activists agreed the decision, coming amid a flurry of efforts by the Clinton administration and Congress to restrict smoking at work and in other public places, could have wide-ranging effect.

''This decision is one more straw to break Joe Camel's back,'' said Karen A. Blumenfeld, an attorney for New Jersey Group Against Smoking Pollution.

Tobacco and vending groups, however, argued the ruling's effect will be slight because, by their figures, 97 percent of cigarettes are sold over store counters.

''The amount of cigarettes sold in vending machines will probably be displaced to the retail outlets,'' said Thomas Lauria, spokesman for The Tobacco Institute, a Washington-based industry group.

Four vending machine companies - C.I.C. Corp., Coast Cigarette Sales, Eskin Vending Corp. and Amusement Music Operators Association - had challenged the ban's legality. Company officials haven't decided whether to appeal to the federal courts, said their attorney, Keith N. Biebelberg.

Rulings elsewhere on municipal bans on cigarette vending machines have varied, generally according to how tightly each state regulates cigarette sales.

Busch noted several court decisions in the past six months, including ones in Massachusetts upholding Provincetown's right to impose a ban and an Ohio Supreme Court decision overturning Cincinnati's ban.

In enacting its ban, East Brunswick cited surveys showing 22 percent of 13- year-old smokers generally bought cigarettes from machines and two-thirds of New Jersey high school students sometimes bought cigarettes from machines.

Brian B. Allen, spokesman for the Chicago-based vending industry group National Automatic Merchandising Association, said its 1989 survey of teen smokers found only 9 percent frequently bought cigarettes from machines and another 13 percent occasionally did.