A longtime criminal defense lawyer in Maryland was charged with sexual solicitation of a minor after using the Internet and text messages to set up a sex encounter with someone he thought to be a 15-year-old boy, according to police allegations filed in Montgomery County District Court on Wednesday.

The lawyer, Michael D. Dobbs, 57, was released on a $100,000 bond after a hearing in a Rockville courthouse two blocks from his law office.

Alex Cordier, a lawyer who represented Dobbs in the hearing, said: “I look forward to Mike being exonerated. I believe the allegations are wildly different than the full story.”

Over the past two months, according to the allegations, Dobbs was snared by a sting technique known by those working in the criminal justice system, adding to the stunned reaction among some lawyers who know Dobbs.

In the stings, detectives post a message on any number of websites used by people looking for sexual encounters. Once a connection is made — and text messages and emails are being exchanged — the detectives hold themselves out to be younger than 16 to the person in the messages. A meeting is arranged. The target of the law enforcement sting arrives and is quickly surrounded by police.

Michael D. Dobbs was charged with sexual solicitation of a minor. (Montgomery County Police)

That is what allegedly happened to Dobbs, who at one point during text exchanges revealed his profession to a person he thought was named “Brandon,” court filings show.

“Im an attorney,” he wrote, according to the court records.

Dobbs grew up in Montgomery County and earned his law degree from the University of Maryland in 1984. He worked as a prosecutor for the Montgomery County State’s Attorney’s Office. His current practice covers a variety of areas: criminal defense, workers’ compensation and personal injury.

“In 25 years, I’ve never heard anyone say a bad word about Mike,” Rockville defense lawyer David Martella said Wednesday. “I think very highly of him as a lawyer and a human being. I hope there is an explanation for the allegations.”

Part of that hope, Martella said, rests on how little sense it makes that a person who knows police techniques would engage in such behavior. “When you deal with people in legal trouble, you quickly become aware of all the efforts of law enforcement out there,” Martella said.

At a bond hearing in court Wednesday, Cordier stressed that Dobbs has no previous criminal record and was cooperative with police after his arrest. The accusation, Cordier said, “certainly is something out of character, and I suspect it’s a misunderstanding.”

“Although the charges are quite serious,” Cordier also said, “the silver lining in all of this is there is not a child really involved.”

During a sting operation, detectives assert, Michael Dobbs drove to this commercial parking lot in Rockville, expecting to meet a 15-year-old for a sexual encounter. The teen was a fiction created online by detectives who as part of their tale professed the teen was a student at the high school, in background, close to the meeting site. (Dan Morse/TWP)

The affidavit written by the detective lays out how the detective set up the sting and quotes emails and text messages allegedly written to him by Dobbs.

On Feb. 2, according to the affidavit, the detective posted a message on a website that stated: “young wm seeking older.”

He received an email from a person who identified himself as “Mark RockvilleGuy,” according to court records, which state the detective posed as “Brandon” and asked: “Are you cool with me being 15. Im almost 16.”

Mark RockvilleGuy kept emailing him and then provided a cellphone number, the police account asserts. The detectives said in court filings that police traced the cell number to Dobbs. Mark RockvilleGuy also sent the detective who was messaging a picture of his face, which detectives said in court filings matched Dobbs’s photograph in Motor Vehicle Administration records.

“As a result of text messages and phone calls with Mark RockvilleGuy,” detectives wrote, “a meeting was set up.”

At 2:30 p.m. Tuesday, undercover officers working the sting operation staked out the parking lot at a commercial rock-climbing facility near Richard Montgomery High School in Rockville. This fit the tale detectives had spun, according to court records, because they’d led Dobbs to believe that Brandon was a student at Richard Montgomery. The plan, according to police allegations, was for Dobbs to pick up Brandon at the lot and go to Brandon’s house nearby.

As police recalled it, Dobbs drove into the parking lot in a Kia Optima, made a couple of trips around the lot and pulled into a spot at the end of a row. Three detectives quickly appeared and took Dobbs into custody.

Detectives said in court filings that they found an iPhone in the Kia. One of the detectives — who had posed as Brandon — called the number he had for Mark Rock­villeGuy, and the iPhone found in the Kia rang, police charge.

Dobbs was questioned and acknowledged that he had communicated via text and email with Brandon, according to the court records.