Bill de Blasio was sworn in as the 109th mayor of New York City early Wednesday, at two minutes past the stroke of midnight.

The oath of office was administered by Eric T. Schneiderman, the attorney general of New York, in a brief ceremony inside the front yard of the mayor’s rowhouse in Park Slope, Brooklyn, where Mr. de Blasio stood with his family behind a chain-link fence and beside a bare-limbed tree.

“I want to say to all of you how grateful we are,” Mr. de Blasio, who wore a black topcoat and cobalt blue tie, told a crowd of journalists and well-wishers, including the actor Steve Buscemi and Howard Dean, the former governor of Vermont.

“From the beginning,” the mayor continued, “this has been our family together, reaching out to the people of this city to make a change that we all needed.” He added: “This is a beginning of a road we will travel together.”