MIAMI — It was always Miami Beach, a barrier island on the sun-dappled Atlantic, that attracted the attention, the glamorous notices, the billions of dollars in real estate speculation.

Just four miles away on the mainland, the sprawling metropolis of Miami suffered for years in the comparison, its scruffy downtown largely devoid of life after offices closed for the day and commuters fled to the suburbs. Inner-city neighborhoods, mired in poverty, were far from investors’ radars.

“It was a ghost town, with vacant parcels, no residential areas, no museums,” said Alan R. Kleber, managing director of the local office of JLL, an investment management company that specializes in commercial real estate. “It was a wasteland with an amazing view.”

Miami long struggled to achieve the patina of prosperity, even though glimmers appeared in the Brickell neighborhood, where condominium towers and office buildings proliferated, and more recently in the Design District, with its elegant boutiques.