The little girl had already confided in a psychologist, a doctor and her family.

At 7 years old, she struggled to recount the trauma of sexual assault again and again, this time for Prince William County prosecutors. But when it came time for trial, the girl was ready. She testified via closed-circuit television and helped lock up her attacker for eight years.

And while it was ultimately the girl’s strength and support from her family that brought her through, she also got help along the way from an unexpected source: an imposing-looking but wholly affable German shepherd named Abby.

“This is the hardest thing these kids will go through in their entire life,” said the girl’s mother. Knowing Abby would be there during visits to the prosecutor’s office made going a little easier, the mother said.

The Prince William commonwealth’s attorney’s office — with Abby’s help — is joining authorities across the country who have turned to four-legged assistants to comfort some of the youngest and most fragile crime victims during the judicial process. More than 40 court-related offices in 16 states use therapy dogs for child abuse and other cases, according to Allie Phillips, who keeps track at the National District Attorneys Association. Other offices use service or facility dogs, which have different certification standards.

Abby is owned by Sandra Sylvester, an assistant commonwealth’s attorney who started bringing the dog to work to help her get used to the courthouse and prosecutor’s office before the formal “courthouse dog” program was launched.

During an initial visit with the 7-year-old and her mother around March 2010, Abby performed some of the tricks she knows: She looked away when offered a treat with the question: “Do you take things from strangers?” Then, she put her paw up when she was read the oath. Abby knows to bark when asked if she promises to tell the truth.

The girl began asking for Abby, and when she went to see prosecutors, she would lead the dog around the office on her leash. Simply petting and nuzzling Abby calmed the girl. Another thing had brought them together as well. A botched surgery left Abby incontinent, and she wears a diaper. The dog’s pain was something the girl could relate to, her mother said. Sylvester would tell the victim: Abby is “very strong; she’s getting through this just like you.’ ”

Using service or therapy dogs to assist victims dates to a district attorney’s office in Queens in the 1980s and a Mississippi courthouse in the 1990s. It has expanded nationwide, and in November the National District Attorneys Association’s board of directors passed a resolution supporting the use of courthouse dogs.

Since November 2011, the child abuse program at Norfolk’s Children’s Hospital of the King’s Daughters has enlisted Pecos, a golden Lab mix, said Michele Thames, a forensic interviewer there. Elsewhere in Virginia, Suffolk and Albemarle County are working to start dog programs, according to Ellen O’Neill-Stephens, who founded Courthouse Dogs.

Prince William is modeling its program on one in Palm Beach County, Fla., that began in 2003.

Florida has laws about how many times a child can be interviewed, and the dogs help put victims at ease quickly, said prosecutor Lorene Taylor. “We want to make sure that we can get the most out of the interview that we can with the least amount of trauma,” she said.

Some programs allow dogs in the courtroom, but those have been controversial. A child rape case in New York state is being challenged by defense attorneys who said the courtroom dog swayed the jury, according to a New York Times article from August. Defense attorneys in other places have said they are concerned a dog’s presence could cause a jury to be more sympathetic or unfairly lend credibility to a victim’s account.

“In any jury trial, we would be concerned that the jury would view the court permitting the dog to comfort a witness as an indication from the court that the witness had indeed experienced trauma,” Lisa Daugaard, deputy director of the Defender Association in Seattle, said in an e-mail.

But Daugaard said she didn’t see a problem with using a dog in an interview room. Creating a comfortable environment “has advantages for truth telling,” she said.

In Prince William, the dogs will stay behind the scenes for now, not in the courtroom. Sylvester said she does not want Prince William to risk a case — and a child’s well-being.

County prosecutors who work on child abuse cases can now call on Abby and a therapy dog named Merlin, an English pointer. Prosecutors will try to match victims’ needs with the dogs’ personalities — Abby is excitable and outgoing while Merlin has more of an empathetic, soothing presence.

The dogs will mostly assist in what prosecutors call the “rapport phase” of interviewing, where they look to establish a relationship with a child. Sylvester said the dogs help children relax to the point where they might begin talking about trauma in their lives.

“The kid will tell the dogs things that happened that they won’t tell people,” said Sylvester, who now prosecutes animal cruelty cases but worked on child abuse cases for more than 20 years. “The child will feel like they can talk about the abuse to the dog because the dog won’t be judgmental.”

Kristina Robinson, who prosecuted the case with the 7-year-old victim, said Abby was a comfort factor in the room and allowed her to establish a trusting relationship with the girl. “I think the dog played a big part in that,” Robinson said.

The Prince William commonwealth’s attorney’s office doesn’t keep annual statistics on its case count, but prosecutors say they are seeing a surge in child abuse crimes since 2008, primarily, they think, because of better reporting.

Prince William Commonwealth’s Attorney Paul B. Ebert (D) said he is hopeful the program will help the youngest victims and help prosecutors. Child abuse cases can be difficult to prosecute and rely heavily on a child’s ability to testify.

“Anything we can do to make them comfortable,” Ebert said.

There are also other benefits to having dogs around the courthouse, a place that can seem cold and bureaucratic even as some people inside are dealing with difficult moments in their lives.

On a recent day when Merlin and Abby were in the prosecutor’s office, Kristen Marek, who helps child victims as a victim witness advocate, was glad to see them there. They lift everyone’s spirits.

“I think animals are just good for the soul,” she said.