Federal prosecutors dropped all charges today against a West Coast surgeon midway through his second trial here for allegedly paying $36,500 to a government doctor in Bethesda to gain approval of the drug DMSO for commercial use.

In an unusual, last-minute arrangement, the surgeon, Stanley W. Jacob of Portland, Ore., read a statement to a U.S. District Court jury acknowledging that the payments to a U.S. Food and Drug Administration doctor were "inappropriate" and created a "conflict of interest" with the regulatory functions of the FDA. Jacob said he sincerely regrets the payments.

Judge Joseph H. Young, at the request of prosecutors, then dismissed the charges of conspiracy and giving an illegal gratuity.

Assistant U.S. Attorney James A. Rothschild told the jury the government agreed to the novel arrangement because it "assures the integrity" of FDA procedures.

Jacob, 58, a professor at the University of Oregon Health Science Center, walked smiling from the courthouse.

"I feel great," he said. "I'm very, very happy."

Dismissal of the case ends a long and tangled effort by the government to prosecute both Jacob and the FDA doctor, K.C. Pani, one of several physicians assigned to evaluate DMSO from 1974 to 1979.

The two were originally indicted in 1981 under federal conspiracy and antigratuity laws. Their first trial ended in a hung jury last May.

Both were scheduled to go to trial again this week, but at the last moment, Pani, 64 and now retired from the FDA, pleaded guilty to a lesser charge of receiving an outside supplement to his government salary for official services.

That left Jacob to go to trial alone.

In opening statements to the jury on Monday, prosecutors depicted him as a zealous promoter of DMSO, bent on getting it approved for commercial use by influencing Pani.

Defense attorney Bernard Fensterwald portrayed Jacob as a brilliant surgeon and a "compulsive philanthropist" who became friends with Pani but was naive about the legal implications of giving him money.

He said $16,000 of the $36,500 Jacob gave to Pani was a contribution to a medical foundation in Pani's native India.

The rest, he said, was a loan to help Pani pay massive medical bills for his wife, who died from diabetes in 1977.

Jacob is considered a principal discoverer of DMSO -- dimethyl sulfoxide -- an industrial solvent used in its purified form to treat a variety of ailments including interstitial cystitis, a bladder disease, and scleraderma, a connective tissue disorder causing thickening of the skin.

DMSO has been approved by the FDA only for interstitial cystitis in the United States, but it is used for rheumatism, muscular and nerve problems and other illnesses in South America and Europe.

Fensterwald told reporters today that prosecutors initiated the idea of dismissing the charges. "They'd heard too much [testimony], and rather than risk losing everything [with an acquittal], they decided on this [arrangement]."

Rothschild disagreed. "With Pani pleading guilty and [Jacob] willing to acknowledge regret, the situation changed," he said. Also, he said, "everybody at FDA got the message, that you don't compromise the integrity of the system by taking money . . . that's the important thing."