On that night in July that Sen. John McCain (R-Ariz.) famously voted against the Republican plan to repeal the Affordable Care Act, most of his colleagues were spellbound as he sat rebuffing a last-minute overture by Vice President Pence.

But not Sen. Kirsten Gillibrand (D-N.Y.).

Republicans huddled in circles worried about what would become of their summerlong push to overhaul American health care, and Democrats quietly marveled at the last-minute meltdown, while the 51-year old junior senator from New York scurried across the chamber with a pen and piece of paper in hand.

She was seeking signatures for a letter to Pentagon leaders, asking that they not discharge any transgender military service members until the Defense Department completed a review of its current policy. Two days before, President Trump had tweeted that he would be ordering the military to stop accepting transgender recruits. Forty-four colleagues signed the letter, and just this week, a federal judge blocked the president’s order.

That kind of basic organizing — seeking signatures on a petition and whipping votes in support of a cause — is a skill Gillibrand learned at an early age at the knee of her grandmother, Polly Noonan, the secretary and close confidante of Erastus Corning, the legendary long-serving mayor of Albany, N.Y., who helped run the powerful Albany County Democratic Party machine from the 1920s into the early 1980s.

“My first foray into politics was my grandmother and her Lady Group. She had this group of women who were incredibly active in grass-roots activism and door-to-door campaigning,” Gillibrand recalled in a 2012 interview with The Washington Post.

“My first political memory is sitting at a campaign headquarters with 40 women at a table stuffing envelopes and putting stamps on them,” she recalled. “It was this image of all these ladies who were so happy and so engaged and doing something outside the home that they really cared about that could make a difference. I’ve really always believed in the power of women and their advocacy and that women’s voices really matter.”

Over her nearly nine years in the Senate, Gillibrand has been notably persistent on issues of equal rights — for gay men and lesbians, transgender people and women. The sexually suggestive attack that Trump lobbed at Gillibrand over Twitter on Tuesday plays right into her portfolio. With a reelection campaign next year that so far has drawn no serious GOP opponent and speculation that she will renege on her vow not to run for president in 2020, the attack may do more political good than harm.

In his tweet, Trump labeled Gillibrand a “lightweight,” who once came “begging” for campaign contributions “and would do anything for them.”

Gillibrand “is now in the ring fighting against Trump,” he added.

The tweet came shortly after Gillibrand dropped off her young sons at school and as she was seated at a bipartisan Bible study session with Sens. Steve Daines (R-Mont.), Mike Rounds (R-S.D.), James Lankford (R-Okla.). Her phone started vibrating, and aides said they pulled her out of the group to inform her and prepare a response.

She was already scheduled to appear at a news conference to unveil a bipartisan bill that would require the installation of underride guards on the front and sides of large tractor-trailers and update federal guidelines on how they are installed on the back of large trucks.

After touting the bill, ushering out her co-sponsors and the family members of people killed in such crashes, Gillibrand called Trump’s attack “a sexist smear attempting to silence my voice.”

“I will not be silent on this issue, neither will women who stood up to the president yesterday and neither will the millions of women who have been marching since the Women’s March to stand up against policies they do not agree with,” she said.

Speaking with reporters, Gillibrand called on GOP congressional leaders to launch investigations into the allegations of sexual misconduct against Trump, saying, “they should be investigated thoroughly. That is the right thing to do, and I’m urging them to do that — as should their constituents.”

Asked about her interactions with the president, Gillibrand told reporters that Trump was “just a supporter. A supporter of my first campaign.”

A few hours later, her reelection campaign sent out a fundraising pitch with the subject line, “Cannot be Silenced.”

Next year will be the third time she has faced New York voters since being appointed to her seat in 2009 after Hillary Clinton resigned to serve as secretary of state. Then-Gov. David Paterson (D) plucked Gillibrand from near-obscurity, opting for a first-term lawmaker barely known outside of tiny upstate media markets over better-known downstate colleagues who had spent years anticipating a potential Senate bid.

A moderate who had touted a favorable rating from the National Rifle Association during her campaigns for an Upstate New York House seat, Gillibrand quickly transformed into a liberal voice who flipped from an “A” to an “F” with the group in less than two years.

She worked with New York City-based lawmakers on immigration reform; embraced the concerns of the city’s gay Democratic donor base in an early push to repeal the military’s “don’t ask, don’t tell” policy; and doggedly pushed for Congress to pay the health-care costs of emergency personnel who responded to the Sept. 11, 2001, terrorist attack in New York.

In a slap at Wall Street — a key source of campaign cash for any New York politico — she was an original co-sponsor of the Stock Act, which bars lawmakers from trading stocks based on nonpublic information gleaned in the course of official duties and requires more frequent stock trade disclosures. She became the first senator to release all of her tax returns for every year she has served in office.

In 2012, she won her first full term with more than 72 percent of the vote — the highest margin for any statewide candidate in modern history — a feat so far unmatched by better-known Democratic colleagues Senate Minority Leader Charles E. Schumer and Gov. Andrew M. Cuomo.

With a six-year mandate and a seat on the Senate Armed Services Committee, Gillibrand plunged into personnel issues across the military. In 2013 and 2014, she led a push to completely revamp how the Pentagon handles allegations of sexual assault, harassment and rape, hauling in military commanders to explain why the different services have handled cases differently — and sparking an intra-Democratic fight over how to proceed.

Gillibrand pushed for a radical solution that would strip military commanders of any involvement in determining how rape and sexual assault cases are handled. But Sen. Claire McCaskill (D-Mo.), who also pushed for significant changes, veered closer to commanders who wanted a say in such decisions.

Gillibrand earned plaudits for winning over such GOP co-sponsors as Sens. Ted Cruz (Tex.) and Rand Paul (Ky.) and eventually, the support of then-Senate Majority Leader Harry M. Reid (D-Nev.). But her proposal ultimately failed.

“I know I can make a difference here. I know that I can find common ground with any senator in that chamber — any senator in that chamber — and I will look for those solutions,” she said in a November 2013 interview.

This year, Gillibrand has emerged as a total opponent of Trump. She has voted against more of Trump’s nominees than any other senator, according to an analysis by the Capitol Hill newspaper Roll Call.

In May, she confronted Deputy Attorney General Rod J. Rosenstein in a closed-door briefing for senators about the scope of an ongoing special counsel investigation. Some senators who witnessed the exchange called her questions “passionate,” and others called them “provocative.”

She was joined in her heated inquiry by Sen. Al Franken (D-Minn.), who is set to resign this month from the Senate after his female colleagues — led by Gillibrand — called on him to step down. In the days since, she has also called on Trump to resign over allegations of sexual misconduct, which put her ahead of most Democratic senators — and seemingly sparked Trump’s attack.

In the 2013 interview, Gillibrand predicted her future, saying that her fight to enact changes in how the military and society handle allegations of sexual misconduct would be “a long journey.”

“I think I will work on this as long as I’m in the U.S. Senate, I think it’s something that will always need advocacy,” she said.

Tuesday’s tussle with Trump proved her point.