BRUSSELS, FEB. 13 -- European Community leaders forged an agreement to overhaul the organization's finances and raise its global profile today after more than 28 hours of talks.

A deal on the most radical financial reforms in the EC's 30-year history was sealed in the early hours of the morning. It will provide a big injection of cash to put the 12-nation group on a sound footing for its drive to scrap all internal barriers in 1992.

Development aid to deprived EC regions will almost double during that time.

The pact emerged amid a near-crisis situation within the community, which, having failed during two previous summits to reach an accord on the same issues, was suffering a cash shortage.

The breakthrough came after a rare retreat by British Prime Minister Margaret Thatcher.

Satisfied that the community was prepared to adopt an unprecedented system of automatic price cuts to penalize farmers if production exceeded preset ceilings, she settled for milder penalties than she had originally demanded.

Her insistence on drastic curbs on runaway subsidies to Europe's 10 million farmers, which swallow two-thirds of the community budget, had threatened to wreck the summit.

West German Chancellor Helmut Kohl, the summit chairman, spent most of yesterday pushing for compromise in private talks with Thatcher and others pressing for curbs.

West Germany and France, with an eye on elections at home in the spring, were anxious to ensure that the incomes of their politically powerful farmers were not cut because of overproduction penalties.

Kohl told a news conference after the accord was reached, "We have put the EC on a solid financial basis."

Thatcher, whose demands were backed by Dutch Prime Minister Ruud Lubbers, said, "We have achieved some of our main objectives: control over agriculture and community spending. We needed this control now, not at some uncertain time in the future."

The agreement here averted the threat that the community would run out of money in the late summer, and it improved the EC's chances of standing up to Japan and the United States on trade issues, diplomats said.