PORTLAND, Maine — For more than a decade, one of Portland’s greatest architectural treasures has been locked away, with few people able to access its vaults.

Now, after being closed to the public in the wake of the Sept. 11 attacks and undergoing a $2.3 million restoration over the past three years, the U.S. Custom House has opened its doors — a crack.

The U.S. General Services Administration, the agency that owns and operates federal real estate, has been showing off the newly renovated building at 312 Fore St. for the past week.

Built 1867-1872 in a blend of Second Empire and Renaissance Revival styles, the three-story structure replaced a custom office on the same site destroyed by the Great Fire of 1866. The new building continued to house the city’s custom office until last year, when the federal government moved the operation to South Portland.

Weather and time took their toll on the Old Port building, prompting the GSA to begin a massive repair in 2010 of the granite and masonry exterior, slate roof, wooden windows and other elements.

“There was plaster coming down everywhere, because the water had gotten into the building,” said Mike Luczkowski, of RTW Enterprises, which manages the property for the GSA.

Now, the Custom House has been restored to its former glory. In fact, the interior looks much the same as it did 141 years ago, according to the GSA, with many distinctive features still in place and looking new once again.

The building’s two-story Customs Hall features a marble floor in a checkerboard design, a narrow balcony where armed guards once kept watch on merchants making tariff payments below, and an 8-foot-tall, four-faced walnut clock. Light floods through arched windows, and the ceiling is trimmed with gilt.

And as it was years ago, the building may soon become a hive of activity.

While the Custom House no longer serves as one, it has been home to a range of federal offices, and more appear to be on the way. The U.S. Coast Guard used it as a dormitory, and the Selective Service System greeted military draftees inside the building.

Today, the building is home to local offices of four federal agencies, including the GSA. Branches of the Federal Protective Service and the Department of Homeland Security are scheduled to move in soon.

While it won’t be open to the public — except by appointment — the Custom House may host public events at some point, said Patrick Sclafani, New England spokesman for the GSA.

“GSA is exploring several different opportunities where the public space could be used in a collaborative manner,” he said. Collaborations could include partnering with the city, nonprofit groups, cultural organizations, and others, he added.

That’s a fate unlike what’s happened to custom houses in some U.S. cities.

In Boston, the custom house and its 496-foot tower were sold to the city in 1987 and then sat vacant for 14 years, before becoming a Marriott time-share hotel. And in Oregon, a custom house serving the “other” Portland has been vacant for nearly a decade while the GSA has tried to find a buyer. A sale was finally completed last fall, but the building is still unused.

“The reason (the Portland, Maine custom house) hasn’t fallen into the same fate is probably that it’s still a viable, operating space,” Sclafani said. “We’re almost full and we’re going to get a couple more [tenants].

“That’s why we had to invest in the building,” he said. “We wanted to preserve the architecture, but you also have to make repairs so that the building can be operated for the long term.”