The House ended weeks of controversy yesterday by approving a compromise bailout package that could pump as much as $2.5 billion of federal money into the tottering Farm Credit System (FCS) in the next year.

The 365-to-49 final vote, which disregarded a series of administration objections, sent the measure to the Senate, where a counterpart version to prop up the huge farmer-owned lending network is inching through the Agriculture Committee.

FCS officials have warned that without a federal line of credit this year, the system faces collapse because of continuing record loan losses caused by lower farm prices and steeply declining agricultural land values around the country.

Despite those warnings, the air of urgency that propelled the bill through lengthy House Agriculture Committee deliberations during the summer diminished in recent weeks as House committee leaders battled over turf and as FCS losses in the first half of 1987 fell far short of projections.

The turf dispute was settled yesterday when Agriculture members went along with changes proposed by Reps. John D. Dingell (D-Mich.) and Fernand J. St Germain (D-R.I.), powerful committee chairmen who contended that a section of the bill usurped their jurisdictions and provided inadequate regulatory safeguards.

That section would provide 90 percent federal guarantees to back up the creation of a new secondary market program for farm real estate loans, a move sought eagerly by the banking industry in exchange for its support of the overall bailout package.

Dingell's Energy and Commerce Committee and the Banking, Finance and Urban Affairs Committee headed by St Germain insisted that the new program, dubbed Farmer Mac, be subject to federal securities laws and that it include more specific standards for pooling farm loans.

The administration has threatened a presidential veto of the legislation unless a final version alters the secondary-market section and changes other sections related to Farmers Home Administration (FmHA) lending policy.

The House-approved bill includes these key provisions:

The first year of the FCS bailout would be financed with a $2.5 billion appropriation that would be offset by the sale of FmHA assets. Future financing, which could go higher than $5 billion by 1992, would have to pass through the congressional appropriations process. Federal aid to the system would be overseen by a Temporary Assistance Corp., which would be empowered to obtain money from the Treasury and to distribute it to the neediest FCS districts.

The FCS, which holds about a third of the nation's farm debt, would be required to carry out a massive restructuring and streamlining that would consolidate land banks and production credit associations and yet retain "local control" of operating decisions.

As a response to farmers' complaints about arbitrary FCS decisions, the bill would require the system to restructure as many troubled loans as possible and FCS borrowers would be assured of certain new rights, such as access to information related to their loans, first opportunity to repurchase foreclosed property and review of adverse credit decisions.