Maryland Sen. Brian E. Frosh has outraised and outspent his fellow candidates in a primary race where polls have consistently placed the veteran lawmaker behind his less-experienced but more renowned competitor in the attorney general contest.

State campaign finance records filed Friday show Frosh (D-Montgomery) has been putting his money to work with three weeks left in the primary, launching television ads, deluging homes with mailers and soliciting contributions from donors. And it has paid off.

According to a Washington Post poll this month, Frosh has cut Del. Jon S. Cardin’s nearly 20-point advantage in February down to 6 percent — with a seven-point error margin — and has distanced himself from Del. Aisha N. Braveboy (D-Prince George’s).

In a dramatic shift, it appears Frosh also has diminished Cardin’s fundraising edge by pulling in more money in the last reporting period, boosted in large part by donations from other candidates and political action committees.

Frosh, 67, started the campaign reporting season with a substantial war chest, but Cardin (D-Baltimore County), who is the nephew of U.S. Sen. Benjamin L. Cardin (D-Md.), was the pace-setter, raising thousands of dollars more than the rest through ticket purchases during the last reporting period.

But Cardin fell behind, raising about $156,000 between May 21 and June 8, compared to Frosh’s $169,500 during the same period. Cardin has about $317,000 in cash on hand.

Meanwhile, Frosh has outspent the front-runner 2-to-1 to promote his candidacy. He has about $252,000 in cash.

Nearly a quarter of his contributions came from elected officials who support Frosh like Prince George’s County Executive Rushern L. Baker III (D) and Sen. Paul G. Pinsky (D-Prince George’s), who are both running unopposed in the Democratic Party for reelection.

Cardin, too, has attracted PAC money and comprised about 5 percent of his contributions.

Braveboy’s fundraising dropped off significantly since the last reporting period, collecting nearly $7,000 in donations, and has $25,000 in the bank.