After 2 1/2 years of hard bargaining between the United States and the Organization of Petroleum Exporting Countries, an accord was reached today to renew funding for the International Fund for Agricultural Development (IFAD) and save the pioneering group from early extinction.

The accord, announced here by IFAD president Idriss Jazairy of Algeria, came this week during the ninth session of the organization's 141-nation governing council. The council approved plans by members -- including the United States, IFAD's major donor -- to provide the organization with a half billion dollars for the next three years.

"The debate was not a question of IFAD getting more or less money," Jazairy said in an interview today, but "whether IFAD was going to survive. Now we know it is going to survive."

The organization was set up by the United Nations in 1977 to help rural development in developing nations with funds from both the developed member nations of the Organization for Economic Cooperation and Development (OECD) and the newly wealthy OPEC nations.

New funding had been stalled since July 1983 because of Washington's insistence that OPEC countries contribute a greater share. Since the beginning, OECD members have carried 60 percent of the new organization's $1.1 billion budget, while the OPEC states have provided about 40 percent.

After more than a year of deadlock, member nations decided last year to reduce the budget to $500 million for the next three years.

According to Jazairy, the details of how that lower figure would be funded finally were hammered out this week. IFAD officials said the compromise was reached after Washington agreed that a change in the balance of funding would be unrealistic in the face of plummeting oil prices and the costly five-year-old war between Iraq and Iran.

As a result, the OECD nations agreed to provide $300 million, the OPEC nations $200 million.