WASHINGTON (AP) _ A suspended Minneapolis lawyer denies charges that he illegally traded on inside information to pay back more than $1 million he allegedly diverted from clients' accounts.

The Securities and Exchange Commission filed a civil complaint against James H. O'Hagan on Wednesday, charging he made $4.35 million in illegal profits by trading on inside information about Grand Metropolitan PLC's bid for Pillsbury Co.

The SEC also alleged O'Hagan engaged in insider trading to repay money taken from client trust accounts.

In Minneapolis, O'Hagan attorney William Mauzy said his client denied trading on inside information but concededed he ''borrowed'' money from clients' accounts. Mauzy said O'Hagan has been charged with theft by the Hennepin County, Minn., prosecutor, but asserted, ''He really didn't have to make a score in Pillsbury to repay the accounts.''

Mauzy said O'Hagan was a ''sophisticated and heavy investor in the stock market'' who accumulated a total of $5 million in his accounts before he began trading Pillsbury securities.

O'Hagan also maintains he bought Pillsbury shares on the recommendation of brokers, who have filed affidavits with the SEC to that effect.

On Dec. 5, 1989, O'Hagan was temporarily suspended from practicing law by the Minnesota Supreme Court.

The SEC complaint, filed in federal court in Minneapolis, accuses O'Hagan of trading Pillsbury securities in 1988 using misappropriated confidential information about Grand Met's pending hostile tender offer.

O'Hagan at the time was a partner in the law firm Dorsey & Whitney, which was local counsel for Grand Met, a British food and beverage producer, in the bid for Pillsbury. Grand Met acquired Minneapolis-based Pillsbury in January 1989.

O'Hagan left Dorsey & Whitney late last February, said Robert Struyk, chairman of the Minneapolis firm.

Struyk said O'Hagan, who specialized in securities, commodities and medical malpractice litigation, had been with the firm since 1963 or 1964. He said Dorsey & Whitney was not involved in the case and had cooperated with the SEC.

The complaint alleges that O'Hagan learned of the pending Grand Met offer in July 1988 after speaking with another Dorsey & Whitney partner.

According to the complaint, between late July and Sept. 21, 1988, O'Hagan bought Pillsbury stock and call options. On Oct. 4, 1988, Grand Met announced its cash tender offer for Pillsbury at $60 per share, driving up the stock's price by $20.

From Oct. 5 to Oct. 17, O'Hagan sold his Pillsbury stock and options, allegedly netting $4.35 million in profits.

Mauzy said in a statement that when O'Hagan learned in September 1988 that Dorsey & Whitney had been approached to act as counsel to Grand Met, he immediately cancelled outstanding orders to purchase options to buy Pillsbury shares.

The SEC complaint alleges that O'Hagan needed the trading profits to repay about $1 million he had secretly diverted from a client of his law firm, Northrup King Co.

The complaint also alleged O'Hagan diverted funds from at least two other clients, which were not identified.

Asked if it was unusual for an SEC complaint to go into such detail about the alleged motive for a violation, Harry J. Weiss, an SEC attorney who worked on the case, said: ''Keep in mind this case is not settled. The complaint contains all evidence that the commission thinks is relevent.''

The complaint seeks a court order requiring O'Hagan to return the profits from his alleged illegal deal plus fines equal to his profits.