Boston is no stranger to miraculous feats of engineering. The city has seen 3 miles of highway buried beneath downtown, the world's longest one-way tunnel extended into the Harbor, and the opening of a quarter-mile-long cable-stayed bridge gracefully spanning the Charles River.

Now, the city is preparing for the latest addition to its pantheon of construction marvels, the opening on the waterfront of a coin-operated toilet that took more than two years and $300,000 to bring from drawing board to reality. And it still hasn't had its first flush.

"This was the perfect storm," said Peter O'Sullivan, the city's director of street furniture, who is in charge of sidewalk restrooms, kiosks, bus shelters, and the like. "There were more complications on this one than on any toilet we've worked on."

City officials commissioned the gleaming commode on the edge of Christopher Columbus Park near the North End as a basic convenience for tourists who line up for ferries to the Boston Harbor islands. It is the seventh city toilet out of a planned 10 that have been built since Mayor Thomas M. Menino vowed to bring such a fundamental amenity to Boston in 1997, after admiring a public toilet in San Francisco. Most have been installed in a few months.

Not this one. Getting it built has whipped up a tragicomedy of frustrations, delays, and engineering prob lems that shows that, when it comes to building in downtown Boston, things rarely go according to plan. "Every time I walk by, it seems like they're digging it up again," said Joanne Hayes-Rines, president of the Friends of Christopher Columbus Park. "I think you get conditioned to all this after you live with the Big Dig for 15 years."

Thankfully for taxpayers, a city contract stipulates that all costs, including any overruns, are paid by Wall Decaux Inc., which builds Boston's toilets and bus shelters in exchange for the right to sell ads on them. The toilets typically cost $250,000.

"We don't pay a penny," said Michael Galvin, Boston's chief of public property and construction management. "Nothing. And we haven't from Day One."

Work on the restroom began simply enough in March 2008, a year after the city first developed the initial plans. But soon after the digging began, workers discovered that the sewer lines were not where they appeared on engineering diagrams. They modified the toilet's plumbing, received city approval for the changes, lowered the unit into place, and bricked over the site. But the toilet sat more than 2 inches above the sidewalk, a violation of wheelchair-accessibility law.

Workers left the unit in the ground for the winter, because the city bans construction from November to April. This spring, they removed it, dug a deeper hole, and lowered it back into place. Worried that sewage would wash into the harbor, they added another pump. Then they relaid the bricks.

"It's just amazing that it's taken that long to put in," said William Walker, president of Water Transportation Alternatives, a ferry service whose passengers have had to scurry several hundred yards inside a nearby hotel to use the facilities. "It's just the contractors that put it in - they've been moving it up and down and up and down."

Yesterday, Walker surveyed the sleek, glass-and-steel restroom, which sat inside a fenced-in construction site, as four workers tested its plumbing and electrical connections. Wall Decaux said it was not surprised by the toilet travails.

"It's really the nature of doing product installation in a dense urban environment and in an old and historic city like Boston," said the company's president, Martin J. McDonough.

Now city officials say the toilet is nearing completion. But no one is quite ready to say when it will open to the public. They estimate it might take another two weeks. "Our technicians are testing it as we speak, so I'm not sure," McDonough said. "But I think it's safe to say, it will be flushing soon."

© Copyright 2009 Globe Newspaper Company.