New City Council Speaker Corey Johnson pledged at his inauguration Sunday to tackle the city’s “affordability crisis” and its impact on working-class residents, the homeless and local businesses.

Johnson, a Democrat representing Manhattan’s West Side from the southern tip of Central Park down to Canal Street, committed to working with state lawmakers within the coming months to extend rent protections for more than one million city apartments and close loopholes in the rent stabilization law that Johnson said has allowed landlords to deregulate units.

“The affordability crisis that grips our city threatens the very existence of our neighborhoods. New Yorkers who have lived in the same community their entire lives now find themselves priced out, unable to afford their rent or even their groceries,” Johnson told the crowd at the ceremony held in an auditorium of the Fashion Institute of Technology. “Many working families are living literally paycheck to paycheck, one missed shift or one medical expense away from eviction or bankruptcy.”

Johnson was sworn in by Senate Minority Leader Chuck Schumer and was joined by dozens of his colleagues in the Council and other high ranking officials, including Mayor Bill de Blasio, who also spoke at the event.

The new leader of the city’s legislative body related the city’s soaring rents to his own experience moving to New York City from his small Massachusetts hometown, shortly after he came out as a gay teenager in 1999. It set off a “chain reaction” that helped him deal with his mental struggles and launch his career in politics, he said.

“When I came out to my family; when I came out at school, I was pretty much before that literally suicidal,” said Johnson, who illegally lived in a New York University dorm when he moved to the city. “That experience of coming here in 2001 as a 19 year old on a wing and on a prayer and on a dream with two suitcases and knowing two people — that’s becoming harder and harder in 2018. I don’t know how many 19-year-olds can come here who don’t come from a wealthy family and have that experience.”

Johnson, who is also the only openly HIV-positive elected official in the state, will take the reins after a crowded and contentious race for the speakership, which included tense moments between otherwise like-minded Democrats. Many of those losing candidates were in attendance. Though Council members Ydanis Rodriguez and Inez Barron — who cast the only dissenting vote for the speakership, a vote for herself — were no shows.

A spokeswoman for Rodriguez said the councilman missed the inauguration because the ceremony conflicted with his youngest daughter’s birthday party. Barron’s office did not respond to request for comment.

Johnson described the race as “emotionally challenging” but said he was still able to call the candidates his friends. The speaker and de Blasio certainly seemed to be on good terms as well. The mayor praised Johnson as a politician with a “burning desire for justice.”

“We send a message to the whole country that an HIV-positive man is one of the great leaders of our city,” de Blasio said.

The speaker was complimented as someone who could keep the mayor in check, however.

Both Schumer and City Comptroller Scott Stringer referenced Johnson’s announcement earlier this month of the creation of a new Council investigations unit to probe city agencies.

“Corey Johnson has made it clear that this Council is going to be a Council of independence, of issue-focus,” Stringer said, “and when you talk to the Council members, his colleagues, there’s really a moment here that Corey Johnson has become the person we need to lead us for the next four years.”