Lt. Gov. Ralph Northam, who is running for governor, has an F rating from the National Rifle Association. (Salwan Georges/The Washington Post)

Two weeks after the mass shooting in Las Vegas left 58 dead and three weeks before he hopes to be elected governor of Virginia, Lt. Gov. Ralph Northam (D) joined a Saturday morning protest against the National Rifle Association outside the gun lobby's Fairfax headquarters.

"I'm a doctor," Northam, a pediatric neurologist, told a crowd of about 200 local gun-control advocates. "I appreciate it when someone says, 'Our thoughts and prayers are with you.' But it's time to take it a step further: We need to take action."

He spoke just as the NRA began airing television ads comparing Northam unfavorably with Republican rival Ed Gillespie.

"Ralph Northam will not defend your gun rights, but Ed Gillespie will," the narrator says, noting that Northam has an F letter grade from the group while Gillespie earned an A.

The NRA plans to spend more than $750,000 on political advertising in the race between now and the Nov. 7 election.

As he has before on the trail, Northam drew on his medical experience to make the case for new gun-control measures. Having treated wounded veterans as an Army doctor during Operation Desert Storm, he said, he was sure assault weapons did not belong in the civilian world. And having seen children with gunshot wounds in his private practice, he said he was convinced of the need for restrictions on who can buy and carry guns.

Northam was joined by Attorney General Mark Herring (D), who is running for reelection, and Justin Fairfax (D), a former prosecutor who hopes to replace Northam as lieutenant governor.

"Each one of us is very proud of our F," Fairfax said.

The NRA ad uses a clip in which Northam expresses pride in a slightly higher ranking, a D-minus, and the spot accuses him of lying.

Northam told the crowd that he believed Democrats could not only win statewide but also take the majority in the state House of Delegates, where they hold only 34 seats.

Virginia general election guide

Lori Haas, state director of the Virginia chapter of the Coalition to Stop Gun Violence, was less optimistic, saying district lines favor Republicans.

Northam and Fairfax, she said, would work to keep bills to loosen gun regulations from passing through the state legislature.

A group from the Unitarian Universalist Congregation of Fairfax has been gathering on the sidewalk outside the NRA's glass building on the 14th of each month, a protest started after the Dec. 14, 2012, shooting at Sandy Hook Elementary School in Newtown, Conn., left 20 children and six adults dead.

About 50 stalwarts show up regularly, the Rev. David Miller said, but the group often swells after a major shooting. The month after the 2016 shooting at a gay nightclub in Orlando in which 49 people were killed, Miller said, about 500 people came.

The protests are a way to channel "anger and sadness and frustration" and hopefully encourage some political courage, he said.

A spokeswoman for the NRA did not immediately return a request for comment.