Democrats selected their nominees for this year’s state elections in a party primary Tuesday.

Sens. Ralph Northam and Mark Herring edged out two first-time candidates to earn the nominations for lieutenant governor and attorney general, respectively.

They join the lone Democratic candidate for governor, businessman and former Democratic National Committee chairman Terry McAuliffe at the top of the party’s ticket for November.

Turnout for the primary was very low statewide, with just about 140,000 people participating.

Northam, a state senator from southeastern Virginia since 2007, defeated Aneesh Chopra with about 54 percent of the vote, earning the nomination for lieutenant governor. Chopra, of Arlington, is a former Virginia secretary of technology and served as chief technology officer in the White House during President Barack Obama’s first term.

“Ralph has been a tireless advocate for women’s health, has worked to strengthen our education systems, and helped pass crucial legislation aimed at improving the health of Virginians and protecting first responders,” McAuliffe said in a released statement congratulating Northam and Herring.

Herring, who has represented western Fairfax and eastern Loudoun County in the Virginia Senate since 2006, garnered just under 52 percent of the votes over former federal prosecutor Justin Fairfax to get the party’s nomination for attorney general.

“I want to thank Justin Fairfax for a hard-fought campaign,” Herring said in a prepared statement. “I want to thank the thousands of Virginians who joined our campaign and supported our vision. I look forward to restoring the integrity of the attorney general’s office so it fights for all Virginians.”

Herring’s Republican opponent is a fellow state Sen. Mark Obenshain, who represents the Harrisonburg area.

“The critical work Mark did as co-patron of the bipartisan transportation compromise is a testament to his commitment to tackling the challenges Virginia’s communities face in a bipartisan manner,” McAuliffe said of Herring. “I look forward to continuing to work with him on issues he has been a leader on in the State Senate representing Loudoun and Fairfax counties.”

Fairfax thanked his supporters in a statement and expressed his support for the Democratic ticket.

“The past 10 months have been an incredible journey. … I am humbled and honored by the great support I have received all across the state. I look forward to supporting Terry McAuliffe and the rest of our very strong Democratic ticket in November,” he said.

The Republican Party of Virginia selected its statewide candidates through a nominating convention, rather than a primary, this year.

Locally, Jennifer Boysko won a Democratic primary in the 86th District over Herb Kemp. Boysko, a former aide to Dranesville District Supervisor John Foust (D), received about 77 percent of the votes and will challenge Republican Del. Tom Rust this fall.