BUFFALO — Along a bend in the Buffalo River here, an enormous steel and concrete structure is rising, soon to house one of the country’s largest solar panel factories. Just to the south, in the rotting guts of the old Bethlehem Steel plant in Lackawanna, where a dozen wind turbines already harness the energy blowing off Lake Erie, workers are preparing to install a big new solar array.

And in Lockport, to the north, Yahoo recently expanded a data and customer service center, attracted by the region’s cheap, clean power generated by Niagara Falls.

After decades of providing the punch line in jokes about snowstorms, also-ran sports teams and urban decline, the Queen City of the Lakes is suddenly experiencing something new: an economic turnaround, helped by the unlikely sector of renewable energy.

The change in Buffalo is so evident that parents who once told their children to seek their fortunes elsewhere are now telling them to come back.