SPRINGFIELD -- A Hampden Superior Court judge on Tuesday ruled Springfield defense lawyer James J. Martin must submit to a buccal swab so the prosecution will have his DNA.

Judge Edward J. McDonough allowed Assistant District Attorney Jane E. Mulqueen's request that a sample be taken from Martin's mouth. She said evidence collected from a victim during a hospital examination yielded sperm cells that could be compared with the defendant's DNA.

Defense lawyer Alan J. Black objected to Mulqueen's motion.

Martin, 40, has denied charges he sexually assaulted two clients. He has been released on his own recognizance with orders to stay away from the alleged victims.

Martin is charged with rape and six counts of indecent assault and battery on a person over 14.

The first case dates back to May, when Martin allegedly assaulted one of his clients after driving her to an alley in Holyoke, according to the indictment and a related Massachusetts State Police affidavit.

The woman told police that Martin made sexually suggestive remarks during a two-hour meeting in his office on May 5, then picked her up outside her father's house the next night with the promise of further legal discussions, according to the affidavit.

Instead, Martin drove to an alley off Lyman Street, turned off his car and "jumped on top of her," the affidavit said. The assault ended when the woman's phone rang and she told Martin "her son fell and she needed to get home," according to the affidavit.

The woman reported the assault on Aug. 24, more than three months later, court documents show.

By then, the Hampden County district attorney's office was investigating a Springfield woman's claim that Martin forced her to perform oral sex on him after she went to his office on June 6 to discuss her upcoming divorce.

After making sexually charged comments, Martin locked the office door and began to grope and undress the woman, who said she felt "frozen" and powerless to stop him, the affidavit said.

When it was over, Martin "pulled his pants up, opened the blinds to his office and told her she was intoxicating," the affidavit said. He also agreed to charge her only $300 an hour for his services, the affidavit said.

The woman went to Baystate Medical Center after the incident and gave a statement to police while there, the report said.

State police searched Martin's home in Granby last month with a court order allowing them to seize his cellphone and other potential evidence, court records show. Investigators also obtained texts messages saved by the victim in the Holyoke case, records show.

"Hey there, it's your favorite attorney," one message quoted in the affidavit reads. "I'm not texting about your case though, Lol."

"I not only want to share my dirty thoughts, I want to be wholly inappropriate and act them out with you," he wrote in a second message, according to the affidavit.

At the time of the alleged assault, Martin was serving as the woman's court-appointed lawyer. Neither the woman's age nor details of the charges against her were disclosed in court documents.

On his website, Martin describes himself as a graduate of the University of Georgia and the Western New England University School of Law.

In addition to representing criminal clients, he also specializes in personal injury and family law cases. Along with his wife, who also is a graduate of WNEU, he practices out of an office at 1145 Main St. in Springfield's South End.

Admitted to the bar in 2007, Martin has no record of disciplinary actions and his status is listed as active, according to the state Board of Bar Overseers' website.