European foreign ministers agreed today on a compromise solution to Britain's long-running financial dispute with its Common Market partners, which had threatened the future of the expanding and increasingly influential European Economic Community.

The tentative settlement was worked out this morning after months of often acrimonious argument among European leaders and 18 hours of overnight marathon negotiations by the Common Market foreign ministers in Brussels. It would greatly reduce Britain's net contribution to the European Community budget in return for British support of increases in Common Market agricultural prices primarily benefitting farmers in France, Ireland and Denmark.

This package must now be approved by leaders of the nine Common Market countries. Most of the others have indicated their approval but British Prime Minister Margaret Thatcher will not act until her cabinet considers the deal on Monday.

She had originally sought last year to have Britain's tax contributions to the Common Market completely offset by its share of agricultural, business and public works subsidies and grants from the community. Although its steady economic decline has made it one of the European Community's poorer nations in per capita income and national product, Britain's net contribution to the Common Market was exceeded only by prosperous West Germany's.

Today's tentative agreement would reduce Britain's net contributions by about two-thirds for each of the next three years, saving the hard pressed British treasury the equivalent of about $2 billion a year.

The increase in Common Market agricultural prices demanded by France as a condition of giving financial help to Britain will raise food prices for British and other European consumers. But British farmers will benefit from new price supports for lamb and mutton, also demanded by France to satisfy its farmers.

French President Valery Giscard d'Estaing, facing a re-election campaign, had vowed to raise Common Market prices paid to the politically powerful French farmers whether or not Thatcher agreed. And Thatcher, fighting an uphill battle to transform Britain's deteriorating economy with her austere monetarist policies, had threatened to disrupt the Common Market's complicated trade subsidy and regulatory arrangements if Britain was not granted significant financial relief.

Italian Foreign Minister Emilio Colombo, who chaired the Common Market foreign ministers' negotiations, declared in Brussels that today's tentative settlement is a just compromise in which "there are no winners and no losers." His government, which holds the current six-month European Community presidency, had worked hard to mediate a settlement

West German Foreign Minister Hans-Dietrich Genscher said "the Common Market has proved its ability to deal with a difficult situation." His spokesman in Brussels said that West Germany, which must make up most of the reduction in Britain's contribution to the European Community budget, had gone further than it intended to meet Britain's demands.

Lord Carrington, who presented the details of the tentative settlement to Thatcher here this afternoon, would not discuss them or Britain's view of the deal. But French sources in Brussels said Carrington told the other foreign ministers there that, although it did not completely satisfy Britain's demands, "I recognize it is everyone's last card, and I will tell my government and let you know its point of view."

If Thatcher does not agree to the settlement, Britain could find itself isolated from the rest of Europe just when Carrington has been helping build the European Community into an increasingly influential force in world affairs. It has been the forum for joint European policy decisions in the Iran and Afghanistan crises and intends soon to launch an initiative on the Palestinian problem in the Middle East.

The dispute between Britain and its partners over community finances, Italian Foreign Minister Colombo told reporters in Brussels today, had caused "a kind of stagnation" that prevented the European Community from "asserting its identity at a time of international crisis."