Senator Chris Murphy was a young United States representative from Connecticut when he stood at a firehouse in 2012 with families from his district as they learned that their children, all first graders, had been shot dead at Sandy Hook Elementary School.

On Tuesday, nearly 10 years later, he stood on the Senate floor in anguish as yet another American city learned that children in elementary school had been gunned down.

“What are we doing? What are we doing?” Mr. Murphy demanded of his colleagues, imploring them to take action on gun control.

“Why do you spend all this time running for the United States Senate — why do you go through all the hassle of getting this job, of putting yourself in a position of authority — if your answer is that as this slaughter increases, as our kids run for their lives, we do nothing?”

His voice at times strained in anger as he confronted his fellow senators with the grief and frustration of a nation that has seen mass shooting after mass shooting with little congressional action: “What are we doing?” he asked. “Why are you here if not to solve a problem as existential as this?”

Mr. Murphy’s address on the Senate floor was viewed hundreds of thousands of times on social media in the hours after 19 children, a teacher and another adult were killed in Uvalde, Texas. It is the deadliest school shooting in the United States since Sandy Hook, which changed the course of Mr. Murphy’s career.

He took office in the Senate less than a month after he watched those parents in Newtown, Conn., learn that their children were not coming home, and spent the next decade trying and failing to enact gun safety bills.

“I have this very deep sense,” he said, “that I will see my time in public service as a failure if I don’t meet the expectations of those parents in Sandy Hook, and Hartford and Bridgeport.”

Mr. Murphy, who holds an “F” rating with the N.R.A., told The New York Timeslast week that he rejected the notion that his crusade is hopeless — that if 20 elementary school children being murdered in Newtown didn’t transform American gun laws, nothing would.

“That’s fundamentally the wrong way to look at how Washington works,” he said. “There are few epiphanies here. It’s all about political power, and political muscle, and we’re in the process of building our own.”

Still, some of his speech on the Senate floor on Tuesday attempted to elicit a change of heart in his colleagues.

Children who returned to school at Sandy Hook after the shooting had to be taught a safeword to use when they were reliving moments from the attack, like stepping over their classmates’ bodies as they fled, Mr. Murphy said.

“In one classroom, that word was ‘monkey,’” he recounted, describing how teachers would then talk the children through their flashbacks. “And over and over and over through the day, kids would stand up and yell, ‘Monkey!’”

“Why?” Mr. Murphy exclaimed. “Why are we here if not to try to make sure that fewer schools and fewer communities go through what Sandy Hook has gone through? What Uvalde is going through?”