Sen. Mark R. Warner (D-Va.) at Rose Hill Park in Berryville, Va., last year. (Astrid Riecken for The Washington Post)

Sen. Mark R. Warner (D-Va.), who once voted against a ban on assault-style weapons, now says that he would support it if structured the right way by Congress.

“You change the trigger, you change the sight, and some weapons are in, some weapons are out. There’s not going to be a perfect solution,” Warner said, in remarks first reported by the Virginian-Pilot in Norfolk. “But the notion that just because it’s hard we shouldn’t do it — I just don’t think we can sit through more of the mass murders and not take action.”

Warner had been hinting that he might support a new version of the assault-weapons ban, which expired in 2004 and was not given a new vote until 2013, in the wake of the massacre at Sandy Hook Elementary School in Newtown, Conn.

At that time, Warner was one of 15 Democrats to oppose the ban; seven of those senators have since retired or been defeated in reelection bids.

Last Sunday, Warner said on CBS’s “Face the Nation” that he could “reexamine” the idea. “I had always been in favor of universal background checks, particularly after Sandy Hook, but I think it’s time for us to have a legitimate debate about restrictions on gun magazines and assault weapons,” he said. “You get into definitions, but the basic notion of these weaponized, militarized weapons need to be off our streets.”

Warner, who narrowly won reelection in 2014, has built a moderate record on gun rights, earning a “C” from the National Rifle Association. His fellow senator from Virginia, Tim Kaine (D), has an “F” rating.

During the 2014 election, the NRA spent just $211 in independent expenditures against Warner; by contrast, it spent $1.2 million against then-Sen. Kay Hagan (D-N.C.), who also opposed the assault-weapons ban but was seen as more politically vulnerable. Hagan lost to Republican Thom Tillis.

Warner’s shift this week is the latest example of a growing boldness by Democrats on the gun issue, after a long period where candidates in swing states and red states tried not to cross the gun lobby. Even the Democratic Party’s 2016 platform was careful in how it discussed an assault weapons ban, saying Democrats would “keep weapons of war — such as assault weapons and large capacity ammunition magazines (LCAM’s) — off our streets.”

Despite the growing rhetoric, just 22 Senate Democrats have sponsored the current assault-weapons legislation.