The Senate, in the most significant legislative action taken in the communications field in 37 years, yesterday resoundingly passed Republican-sponsored legislation that aims both to encourage competition in the telecommunications industry and to free American Telephone & Telegraph Co. to compete in unregulated industries.

The 90-to-4 vote was a victory for Sen. Robert Packwood (R-Ore.), chairman of the Commerce Committee and the bill's chief sponsor; for the Reagan administration, which had supported the legislative effort; and for AT&T, which has argued since 1975 for a major rewrite of the Communications Act of 1934.

At the heart of the new bill is a provision lifting restrictions placed on AT&T by a consent decree the company signed with the government in 1956 that barred AT&T from offering unregulated services. The bill permits AT&T to enter the data-processing business, for example, through a separate affiliate, a concept designed to prevent the phone company from using ratepayers' money to fund unregulated activites.

The legislation was endorsed ultimately by Senate members of every political persuasion, an indication of the political clout of AT&T and the Commmunications Workers of America and the appeal of legislation labled as deregulation.

Packwood said the bill would not have reached the Senate floor without the endorsement of the American Newspaper Publishers Association. The group backed the legislation after it was amended to bar AT&T from originating information services for distribution over its own lines.

That action, however, may result in ending the Justice Department's simultaneous effort to dismantle AT&T, the largest company in the world, in a pending antitrust case here. Top administration officials have pledged to end the case if such a bill nears enactment.

AT&T Chairman Charles Brown, while praising the bill as a "milestone in congressional efforts to forge legislation," said several of the bill's restrictions on AT&T are "doubly tough" on the company. "It puts reins on us, but gives spurs to all the other competitors that either are, or will be, entering the marketplace," Brown said in a statement.

Packwood told reporters after the vote that he will stay out of the judicial matter, but another cosponsor, Sen. Harrison Schmitt (R-N.M.) said he would urge the suit be dropped if the bill was endorsed by the House.

"I'm happy with the bill and happy to have it behind us," Packwood said, noting that he would not "have to think about the bill" for as long as nine months, a reference to the fact that the House telecommunications subcommittee is unlikely to take up telecommunications legislation until early next year.

That panel's chairman, Rep. Timothy Wirth (D-Colo.) said he hoped the House would produce a bill that would differ significantly from the Senate bill. Wirth said that bill "pays little attention to the careful nurturing of competition and less to the transitional issues."

On the other hand, the legislation was hailed by Rep. James Broyhill (R-N.C.), ranking minority member of the Commerce Committee, who said he hoped the House would "recognize the broad-based support" for the Senate bill. Broyhill is expected to introduce a bill similar to the Senate-endorsed measure.

A spokesman for the Computer and Comunications Industry Association called the legislation a "private relief bill for AT&T" and said the bill was passed despite a General Accounting Office study raising questions about the concept of the bill and despite three recent antitrust decisions against AT&T.