This afternoon, I. Michael Heyman cleans out his desk in the Smithsonian Castle and heads for a log cabin on Stinson Beach, a picturesque chunk of the Northern California coast.

The institution the tall, white-haired lawyer leaves behind is considerably different from the one he found when he arrived five years ago to become the Smithsonian's 10th secretary. In the view of many, including Heyman, the vast museum complex has become more of a national presence and less of a strictly Washington one. It's also become richer, more popular and perhaps wiser, too.

And as he looked back a few days before his final departure, Heyman agreed he'd learned some lessons himself.

It was "uncomfortable" at first, he said. He was on a political tightrope from his very first day. When he arrived in the fall of 1994, the complex was in turmoil. War veterans and members of Congress had worked themselves into a cold fury over the tone of an exhibit centered on the Enola Gay, the airplane that dropped the atomic bomb on Hiroshima. They saw it as a cheap shot at the war effort, a slap in the face of people who fought Japan in World War II.

It didn't make life any easier for Heyman when a conservative tide swept Congress that fall. Money was tight. Demands on the Smithsonian were growing. As the first non-scientist to run the complex of 16 museums and the National Zoo, Heyman was immediately under sharp scrutiny from scholars. Disenchanted scientists, conservative critics and Latino and African American activists all seemed eager to test the new guy.

But early on, he proved he was no pushover.

After the federal government shut down in November 1995, Heyman decided the Smithsonian couldn't be closed. A former law professor well versed in plotting clever strategies around bureaucratic roadblocks, Heyman found a loophole, and reopened the National Museum of American History.

He tells of this triumph with considerable pride, casting a cheerful glance through his conference room window in the direction of the Capitol.

"I really got a kick out of that," he said, pushing up the sleeves of his white dress shirt.

"The legal question was to deal with the statute that makes it a crime to spend federal money when it hasn't been appropriated. Luckily my background gave me a heads-up." And Heyman realized he could temporarily move essentials, such as guards on the federal payroll, to the Smithsonian's private budget, and safely open the doors. He greeted visitors himself and then shared his strategy with the National Gallery of Art, eager to let the crowds back in for the blockbuster Vermeer show.

He proved to be a no-nonsense executive. He ordered the Enola Gay exhibit revamped. And since Heyman couldn't shield the Smithsonian from criticism--who could have predicted the museum would be accused of promoting goose abuse because of a forum on pate?--he oversaw the development of exhibit guidelines designed to head off problems.

Yet not all of Heyman's grand plans to make the Smithsonian accessible to more people went smoothly. An unprecedented traveling exhibition, complete with Abraham Lincoln's hat and Dorothy's ruby slippers, attracted 3 million visitors in nine cities but had to be curtailed because fund-raising for it fell far short of its $100 million goal. The institution's Web site was launched under his watch and has gone from a million hits a month in 1995 to 40 million, and a staggering 65,000 pages.

His personal attachments grew quickly and Heyman worried about the place almost until the end, fretting about office space, about public and private funds, about vacancies in the museum director ranks. Then he realized all this could be managed by the next secretary, Lawrence M. Small, the former Fannie Mae president who takes over in late January.

A lot of the pressure lifted when Hungarian-born aviation baron Steven Udvar-Hazy gave the Air and Space Museum $60 million, the largest gift in the institution's history.

"Generally speaking, once we got that huge gift from Steven Hazy, I could stop worrying as much about the future as I had," Heyman said.

In between worries, Heyman took time to enjoy the Smithsonian. He says he became acquainted with subjects, such as astronomy, that he hadn't paid much attention to.

"I have been on the top of Mauna Kea" in Hawaii, where the Smithsonian Astrophysical Observatory has installed some massive antennas, he said.

"And," he continued, "I didn't know anything about contemporary art." But he found that while working out solutions to the latest crisis--maybe the flap over an anti-meat article in a Smithsonian-related children's magazine--it helped to take a breather and look at art. He became something of a sponge, learning about Bruce Nauman, Chuck Close, the Mughal Manuscript and Luba art. "This has all provided great avenues for me," he said.

Heyman was 63 when he took over the Smithsonian, a New Yorker who had spent 31 years at the University of California, Berkeley, as law professor and chancellor. No stranger to Washington, he knew some of how it worked from his year clerking for Chief Justice Earl Warren and a brief turn as counselor to Interior Secretary Bruce Babbitt.

He always described his tenure at the Smithsonian as an interim one. Yet it has been anything but a caretaker era. "He certainly was not housekeeping while other things were happening," said Hannah H. Gray, a Smithsonian regent and former president of the University of Chicago. "I loved his zest for the job and the way he selected so intelligently the things that matter. For the Smithsonian, which is the public presence of American cultural life, he has had to live with a certain amount of noise but he went through it with thoughtful conversation."

"We shouldn't shun controversy. We should do it in a way that is probing but in some way balanced," Heyman said. Still, his move to keep tighter control on controversial shows has raised questions within the rank and file about academic freedom, and even censorship, especially in 1995, when he canceled an exhibit on the Vietnam War. The show was in the early stages of development when Heyman foresaw the same kind of controversy around it as had rocked the country during the war.

Donald Ortner, chairman of the anthropology department at the National Museum of Natural History, says some residue of ill will still exists. "Mike made it clear that academic freedom had to be tempered by sensitivity to our constituents," he said. "The hard truth is that most of us operate without any constraints on what we do."

Heyman established a better relationship with Congress. "I think that talking a lot with members really helped with that, the fact that I was a former Marine helped with that, despite the fact that I was chancellor at Berkeley, that place."

And he won friends. "He didn't try to shove the thing aside, and he didn't make an assumption that the people who were complaining weren't understanding. He wasn't trying to do revisionist thinking," said Rep. Ralph Regula (R-Ohio), the chairman of the appropriations subcommittee that oversees the Smithsonian. "He has exercised good leadership and the Smithsonian is better for it."

He didn't eliminate all the bumps. One morning last July--without any warning, Heyman said--Sen. Mitch McConnell (R-Ky.) raked him over the coals at a public hearing. The senator had been to the history museum and didn't like the permanent show on 19th-century America. In McConnell's view, the curators were saying that immigrants of the time got ahead purely on luck. Months later Heyman is still hot. "I didn't think it was very careful criticism . . . to characterize the whole on the basis of snippets, and the snippets weren't accurate," he said. "That doesn't change the nature of what I think is a good relationship. I think we are in pretty good shape."

Some lessons, as Heyman describes them, were especially hard. "A high point for me was understanding how angry the Latino community was," he said. For years minority groups had been raising questions about the lack of focus on specific history and culture, the lack of minority experts in the curatorial ranks and administration. On the broad Latino issues, a blistering report on the Smithsonian by a review panel the museum created cited it for neglect. Right now a class action suit from Hispanic employees is winding its way through a government review.

Faced with the demands of a diverse culture, Heyman responded by creating focused institutes, but not separate museums. And he prodded the institution as a whole to bring varied views of history, art and culture into the general mix.

The Smithsonian Center for Latino Initiatives was one of the institutes he founded. It is, he said, "essentially the de facto distributor of $1 million a year to the museums for Latino-oriented things, and if that is used correctly it has some real force."

In the African American cultural field, he helped establish a hybrid initiative between the Anacostia Museum and the Center for African American History and Culture. Heyman also points to the budding Smithsonian Asian Pacific American Advisory Group.

But critics within the Smithsonian are worried that the current models are social policy solutions, not ground-breaking intellectual endeavors, and may have killed any prospect for independent museums.

That, however, is no longer Heyman's problem. With his wife, Therese, a curator, he will retire to Stinson Beach to write, perhaps about arts funding or affirmative action and higher education. And he will teach, too, at the Bolt Law School at the University of California. It may say something about Heyman that he did not choose to teach an esoteric subject to upper-level students but instead requested a course aimed at freshmen.

And how will Heyman be remembered in Washington?

Ivan Selin, former chairman of the Nuclear Regulatory Commission, advisory board chairman for the Museum of American History and a member of the Smithsonian's national fund-raising board, sums it up:

"Michael did two big things. He restored a sense of where we are going, what are our objectives. And he pushed for the idea that we are a national institution, not just a Washington institution."

If you prefer to try to quantify the Heyman years, the records show the number of visitors grew to 30 million last year, up from 24 million in 1995. And private fund-raising topped $92 million this year, up from $51.8 million in 1995.