Alex Diment almost got a nasty surprise on his way to work one morning back in February.

“You don’t expect to see that on your way to work,” he said.

Diment said chunks of the facade at 392 Boylston St. crashed down onto the sidewalk, narrowly missing him and other pedestrians.

The Back Bay building has literally been falling apart in recent months and inspectors worry a strong wind could take down one of its remaining walls.

The NBC 10 Boston Investigators dug into its history and found nearly a decade of complaints.

The building is owned by 392-402 Boylston Street Realty, LLC, and Hicham “Sam” Hassan is listed as the manager.

Neighbors and firefighters say issues have been festering for years, and only now that it is putting the public at risk did the city take the owner or Hassan, to court to either fix it up or tear it down.

Last month, the entire back of the landmark building collapsed, leaving a gaping hole three stories tall and forcing firefighters to evacuate the popular roof-top restaurant next door.

“I hope something like that would be a wakeup call before somebody really gets hurt,” Diment said.

Boston Fire Marshal Jack Dempsey ticked off the problems: No interior stairs, rotted roof with a heavy dead load, severe collapse hazard.

Before the wall fell, BFD had marked the building with a red “X” to warn firefighters that the building is empty and could be structurally unstable.

“If you had a large fire that we couldn't go in and handle promptly, it could spread,” said Deputy Fire Chief Gerard Fontana.

The vacant building has been on the department’s problem property list for years.

“Every month that goes by, the building becomes more dangerous,” Dempsey said.

That structure is part of a series of vacant buildings on a multi-million dollar stretch of Boylston, all owned by Hassan.

The NBC10 Boston Investigators ran into Hassan outside 392 Boylston St. one afternoon, and he denied he was connected to it in any way.

According to city records, there have been nearly two dozen violations and complaints against the buildings since 2010, from broken windows and holes in walls to no fire alarms or building materials to help prevent a fire from spreading.

“The owner of the building has chosen to leave the building vacant,” said William “Buddy” Christopher Jr., commissioner of inspectional services for the city of Boston. “That in and of itself creates problems because it doesn't get the supervision and the maintenance that it needs to get done.”

Christopher said the department cannot control if an owner lets their building become an eyesore.

While there have been 10 years of citations, Christopher said the problems have escalated in seriousness just recently.

“There have been nuisance little things that had to be done,” he said. “When we reached the point that we're starting to see structural instability of the building, that’s when the patience wears out.”

The NBC10 Boston Investigators found that in 2011, Hassan and the LLC were cited for serious structural deficiencies, such as substandard conditions, a 10-foot hole, no separation material, unsafe and dangerous conditions, violations of state building code.

Christopher said he couldn’t comment on what happened before he became commissioner.

While he believes inspectors did their due diligence, he said this is the first time to his knowledge that the city has taken Hassan or the LLC to court. But he said the city prefers to work with owners rather than starting what can become long, drawn-out legal battles.

After the collapses in February, the city did order Hassan to put up scaffolding over the sidewalk and install emergency shoring to brace the building. He complied.

But there is still one significant risk that’s keeping two levels of the Globe Bar & Café, the restaurant next to 392 Boylston St., shuttered.

“There is one wall that abuts the restaurant there that is extremely compromised. We’re concerned anything above a 40 mile per hour wind” could bring it down, Christopher said.

Hassan would not comment in person and did not return our phone calls to answer further questions about the compromised wall and the fire hazard.

The city has now filed an injunction to force Hassan to make the building safe while plans are made to tear it down.

Hassan opposed the city’s intervention in state Housing Court, but the NBC10 Boston Investigators just learned he has pulled the proper permits to do the work.

It is unclear how long the restaurant could lose business. The Globe Bar & Café did not respond to our requests for comment. Hassan is the restaurant’s landlord.