The Security Council adopted a British resolution today demanding that Argentina immediately withdraw all its forces from the Falkland Islands. It also demanded an immediate cessation of hostilities and called on both sides to seek a diplomatic solution to their dispute over the territory.

The vote was 10 to 1, with the Soviet Union, China, Spain and Poland abstaining. Only Panama voted against the measure.

Under the U.N. Charter, Argentina is legally obliged to abide by today's resolution. In theory, Argentina could be subject to sanctions if it fails to do so, but no such curbs are expected to be applied in this case.

The Panamanian foreign minister, Jorge Illueca, and Ireland's ambassador, Noel Dorr, argued after the vote that the council resolution should be a substitute for British military retaliation against Friday's Argentine takeover of the archipelago 250 miles off its Atlantic Coast.

British officials insisted, however, that if Argentina fails to withdraw its troops, Britain retains the right to take military action in self-defense, under international law and the terms of the U.N. Charter.

In Buenos Aires, President Gen. Leopoldo Galtieri reacted to the vote, saying "Argentina has respected and respects the pronouncements of this Council . . . but nonetheless, Argentina will keep its freedom of action . . . to satisfy the interests of the nation and national honor that will not be negotiated," United Press International reported.

One American diplomat called the broad support for the resolution--from the West, Asia, Africa and even one South American delegation, Guyana--"a triumph of British diplomacy."

The vote came just 36 hours after the invasion, but Argentina's foreign minister insisted that his government was "firmly convinced of its rights" to the territory and affirmed that "we shall not yield" it.

The foreign minister, Nicanor Costa Mendez, harked back to 1833 to justify his country's action.

In that year, a British fleet displaced the Argentine occupants of the Falklands--which are called the Malvinas by Argentina--"and that act of force cannot give rise to any rights at all," he said.

Costa Mendez also contended that the U.N. Charter provision barring the use of force to settle disputes cannot apply to "wrongful acts that predate the signing of the Charter."

He maintained that Argentina had not staged an invasion but had "recovered a part of our national heritage."

Finally, the Argentine representative, who flew to New York this morning, offered to negotiate "any differences we have with the United Kingdom except sovereignty, which is not open to negotiation."

The British ambassador, Sir Anthony Parsons, made no attempt to debate the centuries-old substance of the dispute, but objected to the Argentine proposition that U.N. Charter principles are not valid for issues that predate its signing in 1945. Were that true, he said, "the world would be an infinitely more dangerous and flammable place than it already is."

The Panamanian foreign minister introduced a rival resolution today, urging Britain to "cease its hostile conduct," refrain from the use of force, and negotiate the decolonization of the islands, "duly respecting Argentine sovereignty and the interests of their inhabitants." The resolution was not put to a vote.

Parsons told reporters after the council adjourned that "we are not contemplating the irresponsible use of force" against Argentina, and "we are certainly not going to initiate hostilities."