[Read more about the mayor’s decision on Friday to end his bid for the Oval Office.]

After five months of a presidential campaign that generated more shrugs than buzz, Mayor Bill de Blasio announced on Friday that he would end his candidacy and focus on his full-time job running New York City.

The clock is running out on Mr. de Blasio’s time in office — term limits prevent him from running for re-election in 2021. As he ventured out on the campaign trail, some New Yorkers complained that their lame-duck mayor’s attention often seemed focused elsewhere.

But as Mr. de Blasio returns to New York, he still has more than two more years in office to build on the progressive track record he promoted in states far from Gracie Mansion and tackle problems confronting his constituents.