The soldiers who landed in Normandy on D-Day were greeted as liberators, but by the time American G.I.’s were headed back home in late 1945, many French citizens viewed them in a very different light.

In the port city of Le Havre, the mayor was bombarded with letters from angry residents complaining about drunkenness, jeep accidents, sexual assault — “a regime of terror,” as one put it, “imposed by bandits in uniform.”

This isn’t the “greatest generation” as it has come to be depicted in popular histories. But in “What Soldiers Do: Sex and the American G.I. in World War II France,” the historian Mary Louise Roberts draws on French archives, American military records, wartime propaganda and other sources to advance a provocative argument: The liberation of France was “sold” to soldiers not as a battle for freedom but as an erotic adventure among oversexed Frenchwomen, stirring up a “tsunami of male lust” that a battered and mistrustful population often saw as a second assault on its sovereignty and dignity.

“I could not believe what I was reading,” Ms. Roberts, a professor of French history at the University of Wisconsin, Madison, recalled of the moment she came across the citizen complaints in an obscure archive in Le Havre. “I took out my little camera and began photographing the pages. I did not go to the bathroom for eight hours.”