Brian Frosh

Brian Frosh speaks at his election night watch party in Chevy Chase. (Rachel Woolf / Baltimore Sun / June 24, 2014)

Brian E. Frosh, a veteran state senator from Montgomery County who championed gun control and environmental protection, defeated two opponents to win Tuesday's Democratic primary for Maryland attorney general.

Frosh, 67, who had trailed in early polls but was better-funded than his rivals, held a commanding lead over Baltimore County Del. Jon. S. Cardin — the nephew of U.S. Sen. Ben Cardin — and state Del. Aisha N. Braveboy of Prince George's County.

After a concession call from Cardin, Frosh addressed supporters at the quaint Women's Club of Chevy Chase. "I will do everything I can to make sure that people in Maryland are safe in their neighborhoods, in their schools, at home, online, that people have clean air to breathe, clean water to drink, they are free from frauds and cheats and I will fight like hell for justice," he said.

Frosh said in a later interview that former attorneys general Stephen Sachs and J. Joseph Curran Jr. "are great role models and I will consult with them. I hope to be the people's lawyer."

Cardin, 44, whose well-known last name had appeared to give him an advantage early in the low-profile race, stood at his election party at a Baltimore restaurant and thanked volunteers and staffers for their support.

"This is a very humbling evening and a very humbling experience," he said. He also thanked his wife, Megan, adding, "I am thrilled that I will have plenty of time to spend with her and our new baby coming in August."

Braveboy trailed both of the other candidates by significant margins.

Frosh will advance to the November general election in the contest to succeed two-term Attorney General Douglas F. Gansler, who was running for governor.

Frosh will face Republican Jeffrey N. Pritzker, a Towson attorney, and Libertarian Leo Dymowski. Pritzker was unopposed in the Republican primary.

Democrats have won every election for the position since 1919.

The race was notable for its abundance of undecided voters until late in the campaign, and for the strong early showing by Cardin — despite collecting less campaign money and fewer high-profile endorsements than Frosh. A poll that was conducted for The Baltimore Sun and published in early June found that 26 percent of likely Democratic voters supported Cardin and 16 percent backed Frosh, while 42 percent had not made up their minds.

The more voters learned about the race, the more Frosh's campaign believed it could blunt Cardin's early name recognition advantage. Ben Cardin, a popular senator, occasionally campaigned with his nephew, particularly late in the race.

But Frosh, chairman of the Judicial Proceedings Committee for the last 12 years, accelerated his media spending in the final weeks and received significant aid from big-name political allies. Among those appearing with him — and aiding in fundraising — was Gov. Martin O'Malley. Frosh also received help from Reps. Chris Van Hollen, John Delaney and Elijah E. Cummings.

Frosh played a leading role in the passage of some of the highest-profile bills approved by the General Assembly on gun control and protection of the Chesapeake Bay.

In his three terms in the House, Cardin pushed legislation against "revenge porn" and cyberbullying, and headed a subcommittee that oversees elections laws. Braveboy, 39, a two-term lawmaker who chairs the Legislative Black Caucus, hoped to benefit from the public squabbling between Frosh and Cardin, which she said was unbecoming of the position.

The attorney general, who oversees a staff of about 450 lawyers, acts as a legal adviser to the governor, the General Assembly and state agencies and courts. The office's legal opinions can affect voters' lives on a broad range of issues, including consumer protections and civil rights. Maryland is one of 43 states that elects attorneys general.

Cardin's campaign was dogged by some controversies, including a report in The Sun that he missed nearly 75 percent of his committee votes during this year's legislative session. He later said he needed to spend time with his pregnant wife and young daughter.

This month, Cardin rejected the endorsement and a $100 campaign contribution from a Baltimore-based rapper after learning that the man, who calls himself Ski Money, is facing charges of human trafficking.

Cardin arrived at the election night party at 9:25 p.m. and immediately began shaking hands and hugging supporters as he walked through the crowd of dozens of supporters and friends.

Ann Sue Grossman, a longtime friend of the Cardin family, said: "They are the greatest family in the world."