When Melissa Mark-Viverito was elected as City Council speaker, some feared that her loyalty to Mayor Bill de Blasio would curtail her independence and influence.
After all, it was Mr. de Blasio who helped engineer her victory so that he could have an ally at the helm of the lawmaking body.
While four years of relative comity have followed between the Council and Mr. de Blasio, Ms. Mark-Viverito, who leaves office at the end of the month, converted many of her doubters by standing up to the mayor when it counted.
Toward the beginning of her tenure, Ms. Mark-Viverito surprised many by joining forces with Police Commissioner William J. Bratton to call for New York City to hire 1,000 new officers — a move that Mr. de Blasio initially opposed. Later, she formed a commission to study ways to close the Rikers Island jail complex, eventually compelling Mr. de Blasio to endorse the idea.
And while the Council never passed a bill that was vetoed by the mayor, some council members — backed by Ms. Mark-Viverito — effectively vetoed the mayor on occasion.
She gave members more leeway to not only move bills forward (sometimes to the surprise or consternation of the mayor’s office), but also allowed individual members to reject projects in their districts, even if they had mayoral backing, like a zoning change sought by a developer in Upper Manhattan, blocked by Councilman Ydanis Rodriguez, or another in Sunnyside, Queens, blocked by Councilman Jimmy Van Bramer. Both those projects were supported by the mayor because they would have provided affordable housing.
“It’s hard to measure a speaker’s independence by the number of bills that get vetoed,” said Rory I. Lancman, a Queens councilman who was among a group of council members who initially opposed Ms. Mark-Viverito’s speaker candidacy. He recalled that when he previously served in the State Assembly, many bills were vetoed by the governor, but few if any of those vetoes were overturned.
“I think she has really disproved anyone who doubted her ability to be a legitimate, strong legislative leader,” he said.
With Ms. Mark-Viverito, 48, barred from seeking re-election because of term limits, she acknowledged some indecision in what lies in her future.
She has visited Puerto Rico, where her mother lives, several times since it was devastated by Hurricane Maria in September. She said that she would like to continue to advocate on behalf of the island’s residents, pushing for more support from Congress.
Some have speculated that she might run for governor of Puerto Rico, or mayor of San Juan, if the current mayor, Carmen Yulín Cruz, who is a friend, runs for governor. “I don’t see that realistically being a role for me,” Ms. Mark-Viverito said. But she added, “I do not close doors.”
Asked if she envisioned running for mayor of New York in four years, she repeated her statement about not closing off options. “I’ve proven the naysayers,” she said in a recent interview in her office on the Council’s side of City Hall. “I love this city. It’s given so much to me.”
Ms. Mark-Viverito can be guarded and intensely private, a demeanor seemingly at odds with the intensely public life of a politician. But as speaker, she surprised at times by using her high-profile position to make startlingly personal admissions.
In 2014, she said in a series of Twitter posts that she had tested positive for human papillomavirus, a common sexually transmitted infection that is linked to cervical and other forms of cancer. She said that she wanted to increase awareness of the condition, its consequences and prevention.
Last year, after a recording emerged of Donald J. Trump, who was then running for president, speaking of forcing himself onto women and grabbing their genitals, she said at an emotional news conference that she had been sexually abused as a child.
“The person I am today is not the same person who walked in the door four years ago,” Ms. Mark-Viverito said in the recent interview, adding that she was now “a much stronger person.”
She has also had moments of controversy. She staunchly defended the decision of the Puerto Rican Day Parade this year to honor Oscar Lopez, a former member of a Puerto Rican nationalist group that conducted a campaign of bombing and terror in the 1970s.
She has been a supporter of Mr. Lopez for years, and Ms. Mark-Viverito said that she had told her staff early on that she would not back down on her support. “He’s a man of peace,” she said.
Perhaps the sharpest criticism of Ms. Mark-Viverito has come from the advocates of police reform, who saw her as an ally when she was elected speaker and hoped that she and Mr. de Blasio together would quickly move to make fundamental changes in policing.
Instead, the advocates have aimed sharp criticism at both politicians. The Council, led by Ms. Mark-Viverito, passed a criminal justice reform package last year that decriminalized a series of low-level infractions, like drinking or urinating in public — taking aim at the longstanding strategy known as broken-windows policing.
But Ms. Mark-Viverito shelved another reform package, known as the Right to Know Act, intended to change the way police officers interacted with the public, such as by requiring officers to inform a person of the right to refuse a search.
Instead of allowing the bills to come up for a vote, she agreed to let the Police Department take internal steps aimed at addressing some of the same concerns.
“We’ve been hugely disappointed with her record on police reform and accountability,” said Monifa Bandele, a member of the steering committee for Communities United for Police Reform. “We love that she’s supported Close Rikers but that’s doing criminal justice reform on the back end and very different from police reform, the encounters on the street, the pipeline into Rikers.”
In recent days, Ms. Mark-Viverito has once again been in talks with council members on a version of the Right to Know Act, and it is still possible that it could come up for a vote before the end of the year. “We’re not done with the legislative session,” she said.
Kathryn Wylde, president of the Partnership for New York City, a business group, said the previous speaker, Christine C. Quinn, was often willing to take a stronger hand with council members, using carrots and sticks to keep them in line.
“Chris maximized the power of the position,” she said. “And I think Melissa had a philosophical commitment to democratization that essentially weakened the role of the speaker, and empowered 50 individual council members to bring forth and secure action on their agenda items.”
Ms. Wylde said that often made it difficult for organizations like hers to influence legislation.
“She’s the genuine article,” Ms. Wylde said. “She cares about results more than power, and she demonstrates that in terms of empowering a City Council that many would say is better disciplined.”