This is a story about a Republican president and a Democrat named O'Brien.

The president was being harassed on all sides by political opponents and now, he was being told, the Democrats had put together a file filled with potentially incriminating information about him. The file was in the office of O'Brien.

So the president ordered a secret and illegal break-in of the Democratic party offices using people on the federal government payroll. The break-in was carried out but the burglars came up empty handed.

The story sounds familiar--just like the 1972 Watergate break-in at the offices of then-Democratic National Chairman Lawrence F. O'Brien. That action eventually led to the resignation of President Richard M. Nixon.

But the events described above took place in 1930, when an earlier Republican president, Herbert Hoover, ordered a break-in at a Democratic party office in New York, thinking potentially damaging files that could topple his administration were stored there.

This episode, and its striking parallels to Watergate, is revealed for the first time in an unlikely place: a new history of U.S. naval intelligence operations between 1919 and 1945 called "Conflict of Duty, the U.S. Navy's Intelligence Dilemma."

The author is Jeffery M. Dorwart, an associate professor of history at Rutgers University who wrote an earlier book on the Office of Naval Intelligence (ONI). The new book is to be published in April by the prestigious Naval Institute Press, an arm of the U.S. Naval Institute in Annapolis.

The link between unauthorized domestic break-ins and naval intelligence is that Hoover used an intelligence officer on active duty and a retired police inspector to carry out the job.

In the 1972 Watergate break-in, it generally has been surmised that the burglars were looking for incriminating information about potential Democratic contenders for the presidency. In the 1930 episode, the reverse situation applied.

"His presidency paralyzed by the worst economic depression in American history and reeling from vicious political attacks," Dorwart writes, "Herbert Hoover had become overly excitable and sensitive to any opposition or criticism. Thus, when he received a confidential report alleging that the Democrats had accumulated a file of data so damaging that if made public it would destroy both his reputation and his entire administration, Hoover determined to gain access to the material."

Dorwart reports that Hoover, using connections to the financial community in New York, enlisted the aid of the Third Naval District Intelligence Officer at the time, Glenn Howell.

As historical documentation for his account, Dorwart uses the secret log books of Howell, which are in the naval historical division at the Washington Navy Yard.

When Howell and his civilian helper, Robert J. Peterkin, broke into the offices in June 1930, they found them empty and, after tracking down the mysterious "O'Brien," evaluated him as a low-level political operator who posed no threat to the president.

Despite Howell's anxieties about his mission, Dorwart reports that "no leaks occurred and details about the president's initiation into political surveillance and abuse of presidential power remained locked in Howell's secret logbook . . . "

Dorwart reports that the Office of Naval Intelligence has sealed the Third Naval District files on this matter. In a telephone interview yesterday, Dorwart said no reference to the episode is to be found in the Hoover library and that the sole specific verification comes from Howell's diaries, some 30 volumes of them, which the family donated to the navy historical division several years ago.

The episode about Hoover and the Democrats portrays the misuse of the presidency and the military "for strictly personal reasons," Dorwart writes. But the bulk of his book is about the dilemma faced by intelligence officers during an era when political passions about alleged subversives ran high, especially in some quarters of the military. In his judgment, the ONI never reconciled very well the contradiction between its legal responsibilities in intelligence matters and its extralegal activities.

Dorwart, in his book, also reports that ONI agents, whose main duty is supposed to be providing strategic and technical information for the Navy, carried out several other domestic break-ins, which he says were illegal. These included repeated surreptitious entries in 1929 of the offices of the Japanese inspector of naval machinery in New York and of Communist Party headquarters there.

He says that ONI, gripped by fear of Communists in the 1930s, collected information on alleged subversives such as historian Charles Beard; chairman of the American Civil Liberties Union, Henry Ward; the key investigator of a Senate committee looking into the munitions industry, Steven Raushenbush; and a pacifist who ONI apparently did not realize was dead.

Meanwhile, Dorwart reports, the intelligence officials failed to discover that a former Naval Academy graduate who was selling secrets to Japan had penetrated the Navy Department.

Dorwart also reveals that President Franklin D. Roosevelt, a Democrat, had become so mistrustful of the ONI and other intelligence agencies that he essentially formed his own private intelligence agency centered around an old family friend and multimillionaire William Vincent Astor.