The hardest chapter to write in any volume of modern history is often the last. As the story nears conclusion, the clean arc of its narrative founders in the untidy present, and each day brings a possible new ending. That explains why writer Ginger Doyel is late with the book the City of Annapolis commissioned about the three-century-old Market House.

Under a deal that once enthralled city hall, gourmet grocer Dean & DeLuca would have moved into the Market House by now, its truffles and cured meats replacing fried chicken and potato wedges. The market would have been open to the hordes of visitors who will flock to Annapolis for the annual sailboat and power boat shows next month. Doyel, who was paid $8,000 to write the book, would have been on hand, autographing copies of "Gone to Market: The Annapolis Market House, 1698-2005."

The coffee-table book would have conveniently underscored, in an election year, a signature achievement for Mayor Ellen O. Moyer (D): renovating the city-owned market while bringing a bit of SoHo chic to salty Annapolis.

Instead, the book remains unpublished, the Market House is vacant, and Moyer says she does not expect her administration to survive the controversy that made Doyel's last chapter such a struggle to write.

"I'm the one who will probably lose the election based on this," Moyer said last week. "Not based on all we've done on public safety, not for our environmental awards, not for our fiscal management, not for all we've done for our beautiful quality of life: This is what will probably cost me the election."

Newly released documents reveal that negotiations with Dean & DeLuca were deeply troubled almost from the beginning. Administration officials were publicly optimistic even as skepticism and frustration privately abounded in some quarters of city hall.

"It isn't just egg on our face," city spokeswoman Jan Hardesty wrote in a June e-mail to Doyel, "it's an omelette."

After the city last year chose Dean & DeLuca to lease and manage the Market House, the gourmet grocery chain partnered with Annapolis Seafood Markets Inc., only later to all but withdraw from the deal by turning the lease over to the local company.

The change angered some City Council members, who saw it as a bait-and-switch.

The acrimony came to a head at a meeting of the city's economic matters committee on Aug. 23, when Aldermen Louise Hammond (D-Ward 1) and George O. Kelley Sr. (R-Ward 4) called for an investigation. Kelley is running for mayor against Moyer.

Three days later, Annapolis Seafood pulled out, citing the risk of litigation and delays as well as the prospect of becoming caught in the middle of a political tussle.

Since then, the mayor and various aldermen have traded blame. Before the documents were released last week, Kelley described the negotiations as "under the table" and the outcome as "fruits of the poisonous tree." Hammond accused city officials of not telling the council that Dean & DeLuca was withdrawing, which she suspected they knew sooner than they let on.

"Instead, they went ahead with this phony lease when they knew darn well it would never be a Dean & DeLuca Market House," said Hammond, whose ward includes the City Dock, where the market is located.

Moyer said last week that her adversaries "have used this as their wedge issue." She said she believes delays and amendments by Kelley's committee are to blame for the failed deal.

Yet the hundreds of e-mails and other documents released last week in response to a public records request by The Washington Post and other newspapers, along with interviews, suggest that Dean & DeLuca developed strong reservations about running the Market House long before the amended lease was approved on May 23.

The company's chief executive at the time, Dane J. Neller, told city officials on Nov. 9, 2004, that the grocer would "not be going forward with this transaction," according to a letter to the city attorney written by a Dean & DeLuca lawyer and dated June 15. In addition, Dean & DeLuca signaled its lack of interest in writing at least twice in the months before the city, in August, publicly acknowledged that the company had withdrawn.

In a joint interview, Moyer and Robert D. Agee, the city administrator, said they had no record of the Nov. 9 communication. They said they believed Dean & DeLuca was simply playing hard to get as a negotiating tactic. They also described Neller, who has since left Dean & DeLuca, as uninformed.

"Just because Dane says something doesn't make it true," Agee said.

When the crowds begin arriving for the boat shows next week, the market will be nothing but 5,000 square feet of concrete in an empty shell.

"It's always bad, in a town that relies on its image as a tourism destination, to have an empty store on Main Street," said Greg Stiverson, president of Historic Annapolis Foundation. "It's really bad to have a focal point like the Market House empty."

The controversy that has embarrassed Moyer and the city is the latest dispute to swirl around the Market House, one of the city's "most cherished, most controversial landmarks," said Doyel, who writes a local history column for the Capital newspaper in Annapolis. The original Market House -- the current building is actually the eighth incarnation -- was the subject of a dispute soon after it opened, at the corner of Market and Duke of Gloucester streets.

A resident complained to the General Assembly in 1698 that "a certaine Small Market House was since so incommodiously erected" as to deprive him of his view. The Market House was relocated, at the resident's expense, and the controversy was resolved.

In 1784, the Market House found its permanent home by the waterfront, and the current structure was built in 1858. The Market House contained a gym for a time and, in 1968, was nearly torn down for parking.

In August of that year, the council voted to raze the building. As it happens, a Moyer was in the mayor's office at the time -- Roger, the former husband of Ellen Moyer -- and elections were looming then, too. Local activists and preservationists filed a lawsuit and took other steps that held off the wrecking ball. After the election, the new council unanimously scrapped the plan.

Recently, opinions have differed on plans for the Market House. Should it cater to tourists, or would a grocery store hew more closely to the institution's original purpose? The building's last tenants were a mix of vendors that sold fried chicken, specialty sandwiches and sushi. The tenants left unhappily, most before their leases expired on Dec. 31.

Moyer said local residents had pressed for a high-end grocery. Dean & DeLuca, which offered to do a $1 million interior renovation, easily prevailed over the only other bidder, Site Realty Group, a Prince George's County firm affiliated with Eastern Market in the District, Moyer said.

Officials envisioned a gourmet grocery at the Market House when they hired Doyel to write the history. Now, finishing the book "is going to be very tricky," Hardesty, the city spokeswoman, wrote the author in a June e-mail.

In its current form, "Gone to Market" ends with the withdrawal of Annapolis Seafood and the city's decision to start from scratch. When the book comes out, by Dec. 1, a new ending may be possible: an Election Day epilogue.

Washington Post staff writer Ray Rivera contributed to this report.

The Market House at the City Dock, which most recently accommodated fast-food vendors, closed nine months ago for renovations and has sat empty since.From top, Mayor Ellen O. Moyer (D) has clashed with city Aldermen George O. Kelley Sr. (R-Ward 4) and Louise Hammond (D-Ward 1) over the failed deal to bring gourmet grocer Dean & DeLuca to the Market House.