Del. C. William Frick (D-Montgomery) said Tuesday night that he could have been “a valuable asset” as Maryland’s attorney general but decided to withdraw from the race and seek re-election instead.

Frick, who had been campaigning for higher office for months, reversed course about one hour before Maryland’s 9 p.m. filing deadline. Despite an energetic campaign, he had gained little traction in the Democratic primary to succeed Attorney General Douglas F. Gansler (D).

A Washington Post poll last week showed Del. Jon S. Cardin (D-Baltimore County) with the support of 22 percent of Democrats and Democrat-leaning independents. He was followed by Del. Aisha N. Braveboy (D-Prince George’s) with 12 percent, Sen. Brian E. Frosh (D-Montgomery) with 5 percent and Frick with 4 percent.

Frick, who was appointed to his House seat in October 2007, won election in 2010. He is now a subcommittee chairman on the Ways and Means Committee and serves as the chamber’s parliamentarian.

“My two terms in the House have been exceptional,” Frick said in a statement Tuesday night. “ I’ve been a part of a team that has enacted marriage equality for all Maryland couples, repealed the death penalty, protected consumers from abuses and begun the task of reforming our tax code.”

He said there is “still much to be done as a member of the House representing District 16.”

The district is represented by three delegates. Eight Democrats will now be competing for those three seats in the June primary. One of the other seven is an incumbent: Del. Ariana B. Kelley (D-Montgomery).

The other current officeholder, Del. Susan C. Lee (D-Montgomery), is seeking the Senate seat representing the district, which is now held by Frosh.