Maryland Attorney General Douglas F. Gansler. (Photo by Bill O'Leary/The Washington Post)

In the second television ad from his gubernatorial campaign, Maryland Attorney General Douglas F. Gansler (D) highlights an episode from 14 years ago in which he criticized a judge for saying “it takes two to tango” during a sex-offense case involving a young girl.

The 30-second ad, airing in both the Washington and Baltimore media markets, begins with a reference to the case, which Gansler handled as the Montgomery County state’s attorney at the time.

“When an 11-year-old girl was sexually molested, the judge attacked her in court, saying ‘It takes two to tango,’ ” a female narrator tells viewers as the ad shows images of young girls swinging and playing with hula-hoops. “But a young prosecutor took that judge on.”

The ad goes on to recount initiatives Gansler has undertaken on behalf of domestic violence victims and others who have been abused. And it promises he will “fight for us” as governor.

The judge’s remarks came at the sentencing hearing of a 23-year-old man who was accused of having sex with the victim in her bedroom after meeting her on the Internet. The defendant, who later said he thought the girl was 17, was discovered by the girl’s mother hiding in a bedroom closet.

During sentencing, Maryland Circuit Court Judge Durke G. Thompson took issue with comments the girl’s father had made about their family being destroyed by what had happened. Thompson said the girl was not “free of fault” because she gave the defendant “some invitation” into her home.

In a news release at the time, Gansler said the judge’s remarks were inappropriate.

“This was an 11-year-old girl,” he said. “This was not a tango. This was sex between an adult and a vulnerable little girl.”

Gansler also criticized the 18-month jail sentence in the case as more appropriate for shoplifting than a sexual offense.

Thompson later apologized for his choice of words but said the sentence was appropriate and exceeded a recommendation from the parole and probation department.

A brief reference to the same case was also included in a 60-second television ad that Gansler debuted earlier this month.

Gansler faces Lt. Gov. Anthony G. Brown (D) and Del. Heather R. Mizeur (D-Montgomery) in the June 24 Democratic primary.

Brown has aired two largely autobiographical television ads in the Baltimore market. Mizeur has yet to run any ads.