Weeks before the blasts, Steve Koczela, president of MassINC Polling Group, found that more than 40 percent of likely Democratic voters and nearly 50 percent of likely Republican voters hadn't settled on a candidate.
"It just doesn't seem like — even as of the last poll — people were really paying attention to who was running," Koczela said. "There's room for any of the candidates to make a move."
On the Republican side in particular, the recent violence shifted the contours of the contest.
GOP candidate Gabriel Gomez, a former Navy SEAL, finished running the marathon minutes before the bombs exploded along the finish line, killing three and injuring more than 260.
Like other candidates, Gomez immediately pulled television ads off the air and suspended campaign activities. He said he was focused on being respectful as he eased back into campaigning the following weekend.
"We can't let the terrorists win and completely suspend what is fundamental right in the United States," Gomez said.
He charged that President Barack Obama's administration should have designated 19-year-old suspect Dzhohkar Tsarnaev an "enemy combatant" and tried him outside the traditional criminal justice system.
Another GOP candidate, Mike Sullivan, says the federal government should have denied Tsarnaev his Miranda rights, tried him as an enemy combatant and revoked his U.S. citizenship.
"Our first concern must always be preventing future terrorist acts against our people," said Sullivan, a former U.S. attorney whose campaign has been reminding people that he previously led the prosecution of shoe bomber Richard Reid.
Republican candidate Dan Winslow, a former judge and chief legal counsel under former Gov. Mitt Romney, said the entire GOP field has experience with national security.
"We've got a Navy SEAL, a former prosecutor and a former judge all in the field for Republicans," Winslow said. "I think we all have our own credentials. The key is, Who's got the better ideas? Who's got the better electability in June?"
The key may also be which candidate can get his supporters to get to the polls as the bombing continues to dominate attention in Massachusetts. State officials were already predicting a low turnout, likely less than 20 percent of eligible voters, even before the attack.
Wendy Becker, 45, of Newton, was among the thousands who visited the bomb site in Copley Square late last week. A registered voter, she said she didn't know the primaries were happening so soon.
"I didn't even know it was Tuesday and haven't cared," she said, noting that her little brother and brother-in-law ran in the marathon. She's been glued to the television coverage of the aftermath ever since.
The general election, featuring the primary winners, is scheduled for June 25.
Associated Press writer Steve LeBlanc contributed to this report.