This year’s “greenest" residential block in Brooklyn is in Bedford-Stuyvesant.

Macon Street between Ralph and Howard avenues was a first-time winner in the annual Greenest Block in Brooklyn contest sponsored by the Brooklyn Botanic Garden.

Two blocks tied for second place in the residential category: Bainbridge Street between Malcolm X Boulevard and Stuyvesant Avenue; and East 25th Street between Clarendon Road and Avenue D.

Montague Street between Clinton and Henry streets was the winner in the commercial block category.

The contest aims to encourage the beautification of the borough’s streets through “greening” activities such as the upkeep of window boxes, tree beds and gardens.

Mark Fisher, the director of BBG’s conservatories and horticultural programs, praised the work of the residents of Macon Street between Ralph and Howard avenues. “It takes tremendous perseverance to transform a street that’s mostly concrete and stone into one that is green and lush,” he said in a statement.

The block had entered the contest almost every year for 15 years, BBG said.

Sheila Gay-Robbins of the Macon Street Ralph/Howard Block Association said they had organized a “beautification committee” and that members participated in cleanup drives, fundraising, gardening workshops and planting dates.

Winners were announced at a press conference on Wednesday morning.