In a park named for the poet who wrote the poem “Trees,” New York is planting its one millionth tree on Wednesday, capping a campaign that reflected the city’s determination to be in the vanguard of fighting climate change.

The tree, a lacebark elm that is eight years old, 25 feet tall and 6,500 pounds, was installed on Tuesday at Joyce Kilmer Park in the South Bronx. Mayor Bill de Blasio and former Mayor Michael R. Bloomberg, in a rare joint appearance, will be there on Wednesday to finish the planting.

The final planting in the campaign begun by Mr. Bloomberg, a political independent, in 2007 punctuates a broad environmental initiative by him in which he worked to create new parkland, make the city more resilient and gird against climate change. Mr. de Blasio, a Democrat, built on those efforts with his pledge to reduce greenhouse gas emissions in the city by 80 percent by 2050.

Other cities, such as Boston, Denver and Los Angeles, have pursued tree-planting campaigns in recent years, but none were as ambitious as New York’s and none have been completed.