Under pressure from congressional leaders, House and Senate conferees put the final touches on a deficit-reduction package yesterday that is expected to cut farm spending by $2.5 billion over the next two years.

The agreement will cut farm subsidies in fiscal 1988 and 1989, but they will be smaller than the 8.5 percent reduction that otherwise would have occurred under a Gramm-Rudman-Hollings budget-reduction sequester.

Meanwhile yesterday, Appropriations conferees reached tentative agreement on most provisions of the agriculture section of the catchall continuing resolution to finance fiscal 1988 federal programs.

The agreement included an unprecedented stripping of power from George S. Dunlop, the assistant secretary of agriculture for natural resources and environment who oversees about 50,000 soil conservation and forestry workers.

At the behest of Chairman Jamie L. Whitten (D-Miss.), the House abolished Dunlop's job and assigned soil and forestry work to Secretary Richard E. Lyng. Whitten complained that Dunlop -- whose name was not mentioned during the debate -- had undermined congressional directives on conservation spending.

The compromise created a new assistant secretary for special services, a spot to which Lyng presumably could transfer Dunlop, but it put the Soil Conservation Service and the U.S. Forest Service directly under Lyng's command.

Whitten insisted that he has "nothing personal" against Dunlop, a former close aide to Sen. Jesse Helms (R-N.C.). He said that Dunlop had ignored orders from Congress to maintain soil-conservation spending.

The budget conferees, divided by hours of wrangling over proposed cuts and major program changes, came to terms late Thursday after they received an old-fashioned tongue-lashing from House Majority Leader Thomas S. Foley (D-Wash.).

Foley, a former Agriculture Committee chairman, accused the lawmakers of attempting to "snooker" Congress by using the budget process to establish new programs and avoid hard decisions. He warned of a taxpayer backlash if the cuts were not made promptly.

With that, the conferees danced away from the more controversial items and worked out a package that would achieve the bulk of the cuts by lowering direct subsidies and price-support loan rates.

The "target prices" that determine direct subsidy payments on major crops would be cut 1.4 percent in each of the two fiscal years. Price support loan rates would drop 3 percent this year and as much as 5 percent in 1989 if needed to achieve more savings.

Among the controversial items dropped were a new loan program for soybeans and oil seeds and a requirement promoted by the dairy lobby to more clearly label imitation cheese on frozen pizzas.

The labeling issue, which proponents claimed would save at least $14 million by reducing surplus cheese purchases, was dropped after conferees worried openly about adverse news coverage and editorials.

Another key element of the package was a new limit on individual subsidy payments drawn up by Rep. Thomas J. (Jerry) Huckaby (D-La.). The provision was aimed at barring farmers from collecting multiple payments by dividing up their farms and qualifying repeatedly for the direct payments. The Huckaby cap would limit an individual to $100,000 in payments.

The Huckaby plan also would prohibit aliens from receiving payments or federal farm aid unless they are engaged in the operation, a step taken to end controversial payments to nonresidents such as the crown prince of Liechtenstein.

In another farm-related matter, the House late yesterday approved a conference agreement that would allow the Farm Credit System to issue up to $4 billion of federally backed bonds. The Senate is expected to add its quick approval to the rescue package and send it to President Reagan for signing.