Jumaane D. Williams was elected as New York City public advocate Tuesday night.

The Democratic Brooklyn councilman won with 33.22 percent of the vote with 98 percent of precincts reporting. He beat 16 other candidates in the special election. The role was left vacant by Attorney General Letitia James  who left the post in January for her current position.

Williams, a native of Brooklyn, thanked his supporters for their votes during his acceptance speech in Flatbush.

“I’m a little bit in shock, so you’ll have to bear with me,” Williams said during his victory speech in Brooklyn. “I’m honored to be serving as your next public advocate.”

Williams also pledged to work with others to strengthen the city he loved.

“We cannot wait, we cannot stand still, because the challenges in our city are too great,” Mr. Williams said. “But the opportunity to create change is even greater.”

As a long time activist, he argued that he’d be forceful in pushing back against Mayor Bill De Blasio when necessary. However, Williams made clear that he was focused on this current position and would not run for mayor in 2021.

“To the mayor, I’m not running for your job!” he said, laughing. “But together we have to make sure the government is working on behalf of the people.”

The mayor was quick to be conciliatory following the election results. As public advocate,the second highest office in the city, Williams will assume the duties of the mayor should he become unable to perform them. De Blasio recalled his time as a public advocate and looked forward to working with Williams.

James also sent her congratulations to her successor. She said the office had the power to create real and lasting change.

Williams will hold the seat for much of the year. In June, there will be a primary to determine who will be the generation election nominee in November. That person will complete the term of James.

Williams ran on a platform of affordable housing, safer streets, equity, transparency and justice.