President Carter stopped here briefly today before taking off for Washington clearly pleased with the results of a week-long European trip during which he sought to dramatize the stakes involved for the West in opposing the Soviet invasion of Afghanistan.

Carter's largely symbolic visit to Lisbon lasted only six hours and was intended as a sign of American support for the restoration of democracy here in 1976 after decades of authoritarian rule.

[Carter arrived at Andrews Air Force Base shortly after 6 p.m. Thursday and, in brief remarks, stressed again the solidarity of the allies. The best thing about the trip, Carter said, according to Associated Press, "is coming back home."]

Carter met privately with Portuguese President Antonio Dos Santos Ramalho Eanes, Prime Minister Francisco Sa Carneiro and Mario Soares, leader of the opposition Socialist Party.

At a state luncheon today, Carter praised Portugal for responding early to the Soviet invasion of Afghanistan and to the taking of the American hostages in Iran.

"Your actions and your words demonstrted that people who value freedom cannot stand idly by while others' rights are ruthlessly suppressed and while a system of international order, so dearly won and delicately maintained, is so callously attacked," he said.

While Carter's trip took place in a European setting, it was dominated by far off Afghanistan.

Carter visited Italy, Yugoslavia, Spain and, today, Portugal, and at every stop he hammered away at the Soviet Union's invasion of Afghanistan and the threat to peace he said that represented not only in southwest Asia but throughout the world.

For Carter, the key event of the trip was the two-day economic summit conference in Venice earlier this week that brought him together with the leaders of the United States' principal allies from Western Europe, Canada and Japan.

As Carter desired, the summit participants issued a joint declaration condemning the Soviet invasion and calling for a complete troop withdrawal. The Venice declaration papered over some serious differences among the allies on how best to achieve a troop withdrawal, but it served Carter's purpose in representing unanimous opposion by the Western allies to the occupation of Afghanistan.

At Venice, Carter also sought to project an image of harmony between him and the other leaders by, for example, publicly approving of visits to Moscow by French President Valery Giscard d'Estaing and West German Chancellor Helmut Schmidt despite his earlier expressed reservations about their separate talks with the Soviets.

In Yugoslavia, Carter renewed a suggestion that there be a "transitional arrangement" in Afghanistan during a Soviet troop withdrawal, which could be followed by American assurances to the Soviets of the neutrality and nonalignment of Afghanistan.

These two developments -- the hard line of the Venice declaration and the face-saving device suggested in Belgrade -- put Carter in the politically comfortable position of being both the harshest critic of the Soviet invasion and the proponent of a possible way to resolve the crisis diplomatically.

American officials clearly hope that Carter's constant reference during this trip to the dangers posed by the Afghanistan invasion will have an impact in Europe, where the Soviet occupation is not viewed as an overriding crisis and where Carter frequently has been criticized as a weak and uncertain leader of the Western alliance.

White House officials also hope the news coverage of the trip will help the president's standing at home, where approval of his leadership continues to slide.

For a week, U.S. television networks have been broadcasting pictures of Carter with people as diverse as Pope John Paul II and the collective communist leadership of Yugoslavia -- useful publicity to a politician seeking reelection.

What, if anything, will result from Carter's week abroad is far from certain, however. Despite the unanimous Venice declaration, serious differences over Afghanistan remain among the allies. For their part, the Soviets do not appear interested at the moment in the kind of proposal Carter made in Belgrade.

The European trip was also marked by an increasingly prominent role played by the president's national security adviser, Zbigniew Brzezinski, the chief administration proponent of a hard line against the Soviet Union.

Brzezinski was unusually active on this trip, granting interviews, including two on network television, and briefing reporters on Carter's activities and positions on a variety of issues.