In 1983 Michael Gannon, a professor at the University of Florida, set out to write a history of his state from the 1500s on. But two years later, with the sort of serendipity that lurks among archived documents and dusty files, he found himself sidetracked in the mid-20th century, a specialist in 16th-century Spanish exploration suddenly mesmerized by World War II.

That detour (it lasted five years) produced "Operation Drumbeat," one of this summer's great reads -- a riveting and revealing account of Nazi Germany's little-known but nearly catastrophic U-boat offensive against the United States in the first six months of 1942. It was a campaign that sank nearly 400 ships, came within an eyelash of cutting the supply lifeline that kept Britain alive, and, Gannon makes clear, "constituted a greater strategic setback for the Allied war effort than did the defeat at Pearl Harbor." In the loss of life alone (some 5,000 compared with roughly 2,400), it was more than twice as costly. For the United States, Gannon argues, "in terms of raw resources and materiel ... {it} constituted the costliest defeat of World War II."

It was also, he discovered to his astonishment, a largely avoidable massacre. The U.S. Navy had been given unmistakable and repeated warnings and yet chose to do nothing. Even as tankers were exploding and burning within sight of East Coast cities and the bodies of their crews were washing up on beaches from Cape Cod to Florida, 25 Navy destroyers idled in nearby ports, never ordered out to fight the handful of U-boats that had placed the entire coastline under siege.

On Jan. 15, 1942, one of the German subs even motored on the surface undetected into the approaches of New York harbor, its officers recognizing such landmarks as the Coney Island Ferris wheel and the WOR radio tower from their only guide, a New York City tourist map. Twenty-seven miles south of the Hamptons, they made their second coastal kill, a British tanker whose oil and corpses fouled the very beaches where summer crowds throng today. But most of America learned then -- and still knows -- almost nothing about it, never dreaming Hitler's war machine ever got that close. Censorship of newspapers was pervasive during the war, and though coastal residents saw evidence of isolated sinkings in their area, most details of the debacle remained classified by the U.S. government even after the war, some as late as 1987.

"In the Library of Congress catalogue I found more than 100 titles dealing with Japan's first attack on the United States," Gannon said the other day on one of his archive-combing visits to Washington. "But amazingly enough, there wasn't a single book-length treatment of Germany's first, and far more serious, attack."

What led Gannon, a moon-faced, bespectacled scholar, into the world of U-boats almost rivals the story he found there.

An Army officer's son who spent many years in Washington and later graduated from Catholic University, he was working as a 14-year-old pin boy in a St. Augustine, Fla., bowling alley the day the Japanese attacked Pearl Harbor, and like most of America he focused almost exclusively for the next few months on the war in the Pacific.

But in the pre-dawn darkness of April 11, 1942, the SS Gulfamerica, a Gulf Oil tanker on its maiden voyage from Port Arthur, Tex., to New York with 90,000 barrels of fuel oil, exploded into flames just four miles off nearby Jacksonville Beach, sending tourists pouring from their seafront hotels in alarm. Light from the inferno silhouetted a U-boat following up its torpedo attack with shells from its deck guns. Flaming oil drifted ashore together with charred corpses, which were stacked on lawns. Suddenly Gannon realized the war was on America's doorstep.

"It was a tremendous public shock," he remembers. "There had been accounts of sinkings in the paper, but mostly they were 'brave survival' stories -- men against the odds." The number and extent of earlier U-boat attacks had been heavily censored, and whatever sketchy reports did appear were downplayed in the newspapers. "But this was something everybody had seen. Jacksonville was then Florida's largest city, and this had happened practically on the beach. You couldn't miss it. People thronged there in cars, called all their friends. It was a tremendous shock and very, very threatening. Nobody felt safe any longer."

Decades later, while researching his history of Florida, Gannon was struck by both the immense amount of military activity in the state during World War II and the large number of U-boat sinkings off the Florida coast.

"I had no idea there were as many {of the latter} as there were, and when I realized there had been no original research done on any of them, I decided to see what I could find out about one for the purpose of a footnote. And I chose the spectacular one I remembered from my boyhood."

A letter of inquiry to the Ministry of Defense in London led him to an organization of U-boat veterans in Hamburg, which referred him to Juergen Rohwer, Germany's leading naval historian, in Stuttgart.

"And from him," Gannon says, still wondering at the gifts of fortune, "I learned that the boat that sank the Gulfamerica was U-123, and its commander was Reinhard Hardegen. And he was alive and living in Bremen. ... So I called information in Bremen and asked for the number of Reinhard Hardegen. He spoke English, and I asked him, 'Are you the same Reinhard Hardegen who commanded U-123?' He said, 'Yes.' I said, 'Are you the commander who sank the SS Gulfamerica off Jacksonville Beach on April 11, 1942?' He said, 'Yes, I am.' I said, 'Might I come and visit you and talk about that and other matters?' And he said, 'You'd be very welcome.' Three weeks later I was sitting in his living room in Bremen, and learning there was a much larger story connected with this man than just one tanker. Here was the man who led the first German attack on America. And his story had never been told, nor had the story of that first six months in any detail. So I decided to tell it."

Hardegen turned out to be a historian's dream, a one-man embodiment of the ironies and ambiguities of war. Gaunt, pale and haunted-looking, he had originally been declared unfit for U-boats due to a chronically bleeding stomach and other injuries from a plane crash. He slipped into the program anyway, however, and so impressed U-boat Adm. Karl Doenitz with his leadership and daring that he was chosen to lead Operation Paukenschlag (Drumbeat) against the East Coast days after Germany declared war on the United States. In five war patrols as a U-boat commander he sank 26 ships totaling more than 136,000 tons, downing five with his deck guns when he ran out of torpedoes. For his exploits he was awarded the Iron Cross, with an oak leaf cluster pinned on personally by Adolf Hitler.

But like most officers of the Kriegsmarine, Hardegen was no Nazi: a creature of the sea, not of politics. When invited to lunch at Hitler's field headquarters in East Prussia, he infuriated his commander by calling into question the Fuehrer's historic neglect of naval priorities and his obsession with land war in the East.

He also, as Gannon documents meticulously with accounts from survivors, furnished food and navigational directions to the lifeboats of torpedoed merchantmen when possible and, in at least one case, forcibly halted a neutral ship to have it pick up survivors of a vessel he had sunk nearby.

Though Gannon said he concedes nothing "to the odiousness of the cause for which {Hardegen} fought," and approached the officer's recollections with more than a little skepticism, he discovered repeatedly that Allied records and German documents that Hardegen could not have known about repeatedly confirmed his statements in impressive detail. Even the official record of Hitler's luncheon that Hardegen attended confirmed the substance of his report, Gannon found.

After five years of research through mountains of documents on both sides of the Atlantic "I found him a highly credible witness," Gannon said.

Destitute after the war, Hardegen was at first mistaken for an SS officer of the same last name and imprisoned. But once turned loose, the scourge of tankers founded a marine oil business in Bremen that has made him today, at 77, a wealthy man.

"I was extremely surprised to find him alive," says Gannon, "not only because of the passage of 47 years, but because of the horrific mortality rate among German submariners." Three out of every four who served in U-boats in World War II never came back -- the highest mortality rate of any service branch of almost any belligerent nation.

Hardegen proved to be not only alive but highly interested in Gannon's book -- enough so that he accompanied the author on an eight-city promotional tour of the United States this spring. "He fielded calls on talk shows with me and everything," Gannon says. "And he was treated everywhere with great respect. I think that touched him very much."

"Operation Drumbeat," however, is more than a book about Reinhard Hardegen. What gives it its dramatic power and pace is Gannon's use (the first ever by a historian, he says) of U-boat Schussmeldungs, or shooting reports, which the Germans, in their obsession with detail and record-keeping, wrote up and kept to describe every battle action down to the serial number of each torpedo.

Coupled with Allied war reports of the same ship sinkings, they paint a global conflict in intensely human terms, providing not only the stories of individual U-boatmen and their merchant sailor adversaries, but in some cases even exact dialogue. They also, says Gannon, triggered "an increasing sense of frustration and anger. As I kept reading these reports of this unopposed slaughter so close to our coast, I kept asking, 'How could this happen? Where was the Navy?' "

The Navy, he finally discovered, was doing "excellent intelligence work" in partnership with the British, who not only were reading the deciphered radio traffic of the U-boat fleet but tracking Hardegen and his fellow attackers day by day as they approached America. Its failure lay in the obstinacy and arrogance of the U.S. Navy's operational high command, particularly, Gannon found to his surprise, in the vaunted person of the late Adm. Ernest J. King.

King, the crusty ("he shaves with a blowtorch," said FDR), much-admired commander who took over the Navy after Pearl Harbor, had commanded the Atlantic Fleet immediately before, and as such was clearly charged with planning America's defense against U-boats, which had been savaging British convoys from America for two years.

But preoccupied with the war in the Pacific and contemptuous of both his own intelligence staff and the hard-won experience of the Royal Navy, King spurned all defensive measures. He refused to order coastal blackouts, so Hardegen and his fellow commanders easily spotted ships against the lights of East Coast cities. He resisted restricting ships to protected convoys, so the Germans picked them off easily, one at a time. He scoffed at offers from civilian yachtsmen and fliers who volunteered their boats and planes for auxiliary U-boat patrols -- an idea later accepted with some success. Most puzzling of all, King refused to order the 25 destroyers along the coast out to challenge the U-boats, and thus, Gannon says, "invited the wolves into the sheepfold." Flushed with the success of sinking 25 ships in 26 days, the hastily ordered Paukenschlag operation turned into a six-month, 397-ship carnage before King and the Navy responded to pleas from Winston Churchill, among others, and took effective steps to halt it.

Prize trophy for Gannon was the discovery of recently declassified daily "sub estimates" sent by the British in those early months of 1942, reporting on U-boat positions and courses. Gannon says he searched around in the National Archives here and discovered proof not only that the reports had been received by the Navy, but that they had been transmitted from Washington to all Atlantic fleet and sea frontier commanders.

Already Gannon's book is making waves among historians. Clay Blair, author of "Silent Victory: The U.S. Submarine War Against Japan," has declared it "Unassailable... . The most reliable and penetrating account of U-boat warfare ever written." The Los Angeles Times gauged it "a ripping good yarn ... that strips away nearly 50 years of official propaganda and popular misconception ...," although it questioned the admiring tone Gannon sometimes takes toward Hardegen.

Dean C. Allard, director of the Naval Historical Center, says Gannon's book in a sense deepens the mystery about why the U-boat slaughter of 1942 occurred. "God knows it was a debacle," he said, "but Admiral King was not a stupid man. I have this feeling there's more of the story yet to be uncovered" by future historians to explain King's inaction. Still, Allard calls Gannon's book "a terrific job" of research and writing, "particularly valuable for his work with German records."

Gannon finds such kudos gratifying, but less so, perhaps, than the riches of discovery itself. He's back at work now on his history of Florida, where his expertise in the 15th and 16th centuries will be more at home.

"But in a sense," he says, "the great reward of doing this book was how little I knew about the subject beforehand. No one is completely objective, of course, but I was able to approach this with no preconceived notions or theories. I was a tabula rasa, an empty blackboard. In a way I'm your everyman off the sidewalk who just heard this story, discovered it was true, and wrote it down."