When a mayor of New York leaves office, little goes out the door but memories — unless he's Rudy Giuliani.

Government rules discourage the city's most powerful officeholder from departing with more than token gifts collected on the job. Ed Koch, mayor from 1978 to 1989, recalls keeping some neckties. His successor, David Dinkins, walked away with knickknacks from his desk, including a crystal tennis ball and a collection of photographs documenting his meetings with celebrities and business icons.

When Giuliani stepped down, he needed a warehouse.

Under an unprecedented agreement that didn't become public until after he left office, Giuliani secreted out of City Hall the written, photographic and electronic record of his eight years in office — more than 2,000 boxes.

Along with his own files, the trove included the official records of Giuliani's deputy mayors, his chief of staff, his travel office and Gracie Mansion — the mayor's residence that became a legal battlefront during his caustic divorce.

The mayor made famous in the aftermath of the 9/11 terrorist attacks has long described his City Hall as an open book.

In a Republican presidential candidates' debate last week, Giuliani asserted: "My government in New York City was so transparent that they knew every single thing I did almost every time I did it. ... I can't think of a public figure that's had a more transparent life than I've had."

But the public record, as reviewed by The Associated Press, shows a City Hall that had a reputation of resistance — even hostility — toward open government, the First Amendment and the public's access to simple facts and figures.

"He ran a government as closed as he could make it," said attorney Floyd Abrams, a widely recognized First Amendment authority who faced off against city lawyers when Giuliani sought to shut the Brooklyn Museum of Art because the mayor considered a painting sacrilegious.

Giuliani official: He ran an 'open' governmentGiuliani's decision to commandeer his historical records in late 2001, as he prepared to leave office, was just one of many episodes during his term, both in and out of the courtroom, that demonstrate his efforts to control, withhold or massage information to advance his agenda and hobble critics.

The litany of questions Giuliani has faced in recent weeks about undisclosed business clients and furtive billing practices for police security during trysts with then-girlfriend Judith Nathan are reminiscent of the dozens of lawsuits filed by news organizations to obtain public records, of the numerous state Freedom of Information Law requests that nonprofits like the Coalition for the Homeless were forced to file, of access to City Hall steps denied to protesters.

At times, the number of working water fountains in city parks was hard to ascertain without making a formal request. Under Giuliani, it became more difficult to determine the number of complaints filed against the city's home care program, the number of firearms discharged by police and the number of inspectors in the housing and buildings departments. Even details about the city's recycling program were hard to come by.

In a statement issued through the campaign, former Deputy Mayor Randy Mastro said Giuliani "ran an open and transparent administration," made himself available to the press daily, frequently participated in town hall meetings and released information about city services and the budget on a regular basis.

"Indeed, there was probably no elected official in this country who made himself as available to the press and public as Rudy Giuliani did when he was mayor of New York City," Mastro said. "Nitpicking aside, Rudy Giuliani ran a government based on the need for openness and transparency. These are basic principles Rudy will govern by and enforce from the top down as president of the United States."

Critic: He was 'worst in living memory'Since 9/11, Giuliani has frequently cited security concerns as a rationale for secrecy. But history shows that he operated a secretive administration long before the jetliners struck into the World Trade Center towers.

"Mayor Giuliani was in many respects a good mayor, but in regard to First Amendment-related matters, he is surely the worst in living memory," Abrams said in an interview.

More than two dozen lawsuits were filed during Giuliani's mayoralty accusing his administration of stifling free speech or blocking access to public records. The city lost most of the lawsuits, including fights against the state comptroller, the city public advocate and the city's Independent Budget Office. Giuliani often blamed such battles on political enemies.

In his time in office, determining how many police were on the beat became more difficult to ascertain. Critics of the mayor were sometimes denied use of public property to hold events.

Advocacy and oversight groups long accustomed to easily obtaining information about city services and finances — the Citizens Budget Commission and the Women's City Club among them — were required to file freedom of information requests for documents, often resulting in months of delays and added legal costs.

In a slap at Giuliani's City Hall, a judge in one such case wrote bluntly, "The law provides for maximum access, not maximum withholding."

Attorney Eve Burton, who represented the New York Daily News during much of the Giuliani era, said the newspaper submitted more than 100 filings in six years related to information or access requests, appeals or lawsuits involving the administration. In one case, she said, the city refused to turn over the names of people who held gun permits — unquestionably public information — until threatened with a lawsuit.

"It is an unblemished record for secrecy," said Burton, now general counsel at the Hearst Corp.

Whereabouts often unclearGiuliani depicted himself as a round-the-clock mayor, but his whereabouts were often fiercely shielded by his staff, particularly in the later years of his mayoralty, when he was cheating on his wife with Nathan, using decoy vehicles and surrounding himself with a Secret Service-esque security team that traveled in caravans of SUVs.

His personal life became a public riddle. In mid-2001, Giuliani fled the mayor's residence and began bunking with friends, a gay couple — an arrangement eventually disclosed by the Daily News.

In May 2001, in the midst of the mayor's divorce proceedings, one of Giuliani's top lawyers seized from a city library a document with blueprints to Gracie Mansion and blocked access to another copy. At the time, the mayor and his wife were arguing in court over whether Nathan should be barred from the official residence. Giuliani's office said the blueprints could pose a danger in the wrong hands, but the Police Department later ruled that the document was no security threat and it was placed back in public circulation.

In the name of heightened security, Giuliani all but cut off public access to the steps of City Hall, long a civic soapbox. New security cameras scanned anyone entering or leaving the building and kept watch on the grounds. Rules were eased somewhat after a judge found that the city had unfairly restricted access.

When Village Voice reporter Tom Robbins sought expense records for a city housing agency headed by the son of one of Giuliani's closest political advisers, he was told they had been lost. Finally released to the Voice more than a year later, after Giuliani left office, the documents led to an investigation that ended with the guilty plea of Russell Harding, who embezzled more than $400,000 from the city to finance a personal spending spree and download child pornography onto his computer.

AIDS demonstrators were forced to hold a City Hall protest in a steel pen, as police sharpshooters patrolled the roof, an NYPD helicopter thumped overhead, and dozens of police kept watch on foot and motorcycles. Giuliani called the extraordinary security justified.

Break from predecessorsGiuliani's spiriting away of his mayoral records was particularly grating to many.

The traditional home of mayoral records dating to the mid-19th century is New York's municipal archives, a public storehouse where documents are sorted and indexed for the benefit of posterity.

But in a break from predecessors, and some argue the law, Giuliani, in his final days in office, shipped more than 2,000 boxes of correspondence, appointment books, audiotapes, e-mails, telephone logs, briefing memos, private schedules and videotapes and photos to a storage facility in Queens.

The materials were placed in the custody of a private, nonprofit group allied with Giuliani, under an agreement between the city and the Rudolph W. Giuliani Center for Urban Affairs, which, at the time, had no board and no permanent site.

After the arrangement became public, Giuliani promised that once the records were placed in the hands of a private archivist, they would be "more accessible rather than less." In fact, some records from prior mayors remain uncataloged in boxes, in large part because no other mayor has financed a private effort to catalog the materials.

But his assurances did little to ease the anxiety of historians and open-government advocates who wondered if his goal was to reshape — rather than protect — history.

Or worse, erase it — especially with a run for the presidency looming.

The records "were the property of the city. They were not his to take," said Robert Freeman, one of the most widely respected advocates for open government in the country, who heads New York State's Committee on Open Government.

Critics say questions loomOver time, the records were microfilmed and returned to the city archives. Giuliani aides have bristled at suggestions that documents were withheld, scrubbed of embarrassing details or destroyed.

But "there will always be questions," Freeman added.

The administration of Giuliani's successor, Michael Bloomberg, is confident the records were returned. City archivists echo that assessment but, when questioned, acknowledge the situation is less than definitive.

When asked if everything that left City Hall with the mayor had been returned, archives director Leonora Gidlund said, "That's not a question I can answer. I wasn't physically there."

In 2003, New York City enacted a law forbidding sitting mayors from hiring private firms to archive their papers.