An assault weapons ban was never going to attract senators like Joe Manchin III, Democrat of West Virginia, and Patrick J. Toomey, Republican of Pennsylvania, with A ratings from the National Rifle Association, whose support would be needed for a compromise. And Democrats now privately complain that Ms. Feinstein’s bill seemed to rally gun control opponents, who could point to it as Exhibit A in what they perceived as a federal conspiracy to take guns away from law-abiding citizens.

But she proceeded undeterred, even after Senator Harry Reid of Nevada, the majority leader, told her late last month that the weapons ban would not be included in the main gun control package because it lacked sufficient votes.

Drawing on her lessons from the 1994 debate, Ms. Feinstein wrote and rewrote the language in her proposal in the days after Newtown to try to assuage concerns that it would ban weapons favored by hunters and target shooters. She exempted more than 2,200 different guns.

She met with police fraternal organizations, sheriffs’ associations and mayors. And almost everywhere she went as Wednesday’s vote approached, she carried a file folder with her vote count on one side and, on the other, a front page of The Daily News with the headline “Shame on U.S.” written over the photos of the 20 child victims from Newtown.

“This is a mission for me,” she said Wednesday in an interview. “As I look at the pictures of these children, I just can’t believe that this happened.”

Reflecting on what has changed since 1994, she noted the growing power and inflexibility of the National Rifle Association on any new gun laws and the use of the filibuster in the Senate, which Democrats did not have to overcome when the assault weapons ban passed 19 years ago.

“Then there was a very different feeling in the Senate,” she said.

On Wednesday afternoon right before the Senate voted on her bill, she stood on the floor and implored them, “Show some guts.”

Then, as the Senate clerk read through the roll call, her colleagues came up to where she was standing near the front of the well, and one by one patted her gently on the back.