Manhattan City Councilman Corey Johnson was elected city council speaker Wednesday afternoon, garnering almost every vote.

The 35-year-old's fellow council members voted him in 48-1, with Brooklyn City Councilwoman Inez Barron, who recently joined the race, voting for herself.

Brooklyn City Councilman Jumaane Williams, one of Johnson's competitors for the position, and Staten Island City Councilwoman Debi Rose were not present for the vote.

Williams, who was in Albany for Gov. Andrew Cuomo's State of the State Address and did not end his candidacy when Johnson had secured the required number of votes a few weeks ago, congratulated Johnson on Twitter.

The position of city council speaker is considered to be the city's second-most powerful political leader, just behind the mayor.

The speaker directs the council on a number of important city issues and takes the lead in negotiating with the mayor.

Johnson represents the West Side Manhattan district that former City Council Speaker Christine Quinn previously represented. He now replaces Melissa Mark-Viverito, who was term-limited.

There was some simmering discontent in the council Wednesday that Johnson's election meant Johnson and Mayor Bill de Blasio, both white men, would hold the most powerful political positions in the city.

The only citywide elected official who is not a white man is Public Advocate Letitia James, who is an African-American woman.

Johnson told NY1's Courtney Gross on Monday that he thinks the discrimination he has faced because he is openly gay and is HIV-positive will make him receptive to the issue of the lack of diversity at the top of city government.

In his remarks after the vote, Johnson emphasized that he will support all his councilmembers as he leads the 51-member body.

"I want you to know that, in good times and in bad, through thick and thin, I will always have your back," Johnson said in the council chambers. "Those of you who supported me, those who didn't support me, those who ran for speaker, and those who have been here in this body, and those who are new — I will have your back."

Johnson has made it clear that he wants the city council to be more independent of the mayor, and said he would be willing to gather the support to overrule a mayoral veto or pass a legislation that de Blasio opposes.

Johnson said he intends to meet with every member of the city council over the next two days as he makes decisions about committee assignments.