Removable flood walls would be erected in lower Manhattan, and levees, gates and other defenses would be built elsewhere around the city under a nearly $20 billion plan proposed Tuesday by Mayor Michael Bloomberg to protect New York from storms and the effects of global warming.

The plan — which would also include the building of marshes and the flood-proofing of homes and hospitals — is one of the biggest, most ambitious projects ever proposed for defending a major U.S. city from the rising seas and severe weather that climate change is expected to bring.

It was outlined seven months after Superstorm Sandy drove home the danger by swamping lower Manhattan and smashing homes and businesses in other shoreline neighborhoods.

“This is urgent work, and it must begin now,” Bloomberg said in a speech at the Brooklyn Navy Yard, acknowledging that much of the construction would extend beyond the end of his term this year.

“Piece by piece, over many years and even decades, we can build a city that’s capable of preparing better, withstanding more and overcoming anything.”

A roster of environmentalists and real estate interests hailed the $19.5 billion proposal as far-reaching and comprehensive. Former Environmental Protection Agency Administrator Carol Browner commended Bloomberg for “leading the way in finding creative and sustainable strategies for cities to become more resilient and secure.”

Still, it remains to be seen how the ideas will fare in a future mayoral administration and what kind of support — financial and otherwise — they might get from the federal government and other entities, not to mention from New Yorkers themselves.

Bloomberg said the city and federal money already allocated for Sandy relief would provide $10 billion for project, and the city believes it could get at least an additional $5 billion in federal money.

In a 400-page report on the plan, city officials said other options include a small surcharge on homeowners’ insurance, about $1 a month for a homeowner who pays a $1,000 premium a year.

Bloomberg acknowledged that some of the ideas could block views of the water and otherwise prove controversial, but “if we’re going to save lives and protect the lives of communities, we’re going to have to live with some new realities.”

After Sandy, at least some New Yorkers are ready for it, said James Molinaro, the borough president in hard-hit Staten Island, where the plan calls for a 15-to-20-foot levee to guard part of the island, among other measures.

“The constituents that I talk to would take a 15-foot wall tomorrow,” he said.

The plan does not call for the construction of giant storm-surge barriers to protect all of New York Harbor — an idea some researchers and residents have promoted but Bloomberg has long called impractical.

But the mayor said smaller systems of gates and levees should be built to help shield a creek in Brooklyn and possibly other waterways that can carry floodwaters inland.

The removable flood walls in lower Manhattan would essentially be a system of posts and slats that could be put up before a storm. They would be at ground level, perhaps combined with planters or an esplanade. The approach is used along some Midwestern rivers and in the Netherlands, city officials said.