Gun control legislation screeched to a halt Wednesday after­noon in Washington, but the issue continues to be a flashpoint in the race for Senate in Massachusetts.

Four of the five candidates running for the open seat said they would have voted for the bipartisan amendment expanding federal background checks for gun purchases that failed in the Senate Wednesday. Republican Michael J. Sullivan, a former US attorney, was the only candidate who said he would have opposed the compromise.

Following the attacks at the Boston Marathon, all five candidates suspended campaign activity. None was on the trail when a package of gun control legislation failed in the Senate. But with the primary election less than two weeks away, the issue is likely to be back in the spotlight in the ­final days of the race.

Interviews with all five candidates on the issue before Monday’s attacks provide a window into how each sees the issue and how their perspectives were shaped by their experiences with guns and gun violence.

On the Democratic side, US Representative Stephen F. Lynch lost a cousin to gun violence two decades ago. US Representative Edward J. Markey was seared by a spate of homicides with cheap guns, the so-called “Saturday Night ­Specials,” in his hometown of Malden during the 1970s.

Among the Republicans, Gabriel E. Gomez developed a deep knowledge of guns as a US Navy SEAL. Sullivan stood at homicide scenes and prosecuted gun crimes as a US attorney. He also served as acting director of the Bureau of Alcohol, Tobacco, Firearms, and Explosives. State Representative Daniel B. Winslow, the ­only gun owner of the group, described receiving death threats when he was a judge and, fearing for his family’s safety, purchased a firearm.

Those experiences shaped each candidate’s policy stances on the contentious, emotional issue of how guns ought to be regulated by the federal government.

Most of the splits among candidates divide along party lines: the two Democrats support bans on assault weapons and high-capacity ammunition magazines. All three Republicans oppose those measures, seeing them as ineffective.

But on the issue of expanding federally mandated background checks for firearms purchases at gun shows, ­Sullivan stands alone.

The key compromise on that issue, an amendment crafted by Senator Joe ­Manchin, Democrat of West Virginia, and Senator Pat Toomey, Republican of Pennsylvania, garnered 54 yes votes in the Senate Wednesday, but failed to meet the 60-vote threshold needed to move forward.

In two interviews with the Globe, Sullivan called that amendment “feel-good legislation” and argued that it would do nothing to prevent guns from getting into the hands of criminals and people whom a court has judged to be mentally ill. He said he instead wants to fix the background check system by providing better information for sellers about buyers who have been judged to be mentally ill.

Gomez and Winslow said they would have supported the compromise amendment in the Senate. Markey and Lynch both said they would prefer ­expanded gun control legislation, but would have voted for the compromise amendment.

In a statement from his congressional office Wednesday evening, Markey slammed the Senate for failing to move gun control legislation forward.

“It is unacceptable that four months after Newtown, the Senate could not make progress even on a common-sense, bi-partisan proposal,” he said in the statement.

Under current law, only some gun purchases at gun shows require the federal background check that all purchases at a gun store require. That is known colloquially as the gun-show loophole. Sullivan does not see it as a loophole.

“Criminals don’t go to gun shows to buy their guns,” he said. Requiring all gun show buyers to have background checks “doesn’t do anything in terms of advancing the efforts to keep guns out of the hands of criminals,” he said.

In interviews, all Sullivan’s opponents said they wanted to close the gun show loophole, but there were nuances in their positions on expanding background checks.

Both Lynch and Markey support mandated background checks for every single gun purchase, even between family members. “I think it should just be a standard” for every purchase, Markey said.

Lynch also advocated adding questions about the mental capacity of gun buyer’s housemates on the background check form.

“Who is in the home?
” Lynch said. “Are there individuals in the home who are psychiatrically impaired? You ask those questions.”

Gomez and Winslow said they believe there should be certain exceptions on background checks, particularly for transfers among family members.

“If you’re a grandmother giving your guns to your granddaughter, for example, I think family transactions should not have background checks,” ­Winslow explained.

For now, much of the debate on gun control legislation is moot, as the current push for new laws is essentially halted.

But gun control may well be on the docket for whoever becomes the Commonwealth’s next senator.

“This effort is not over,” President Obama said in a press conference Wednesday, knocking the Senate for not moving the legislation forward.

“I want to make it clear to the American people we can still bring about meaningful changes to reduce gun violence,” he said. “I see this as just round one.”