But for a call of nature, Marcus Lee might have gotten away with it.

After breaking into a Gaithersburg home, Lee and at least one other man fled in a stolen Toyota Camry to a 7-Eleven, where by then they were joined by a third accomplice. Lee spent a long stretch in the restroom while the others waited outside — not knowing, apparently, that police were already looking for the car.

Moments later, the officers closed in.

The unusual assertion was advanced by prosecutors Wednesday as Lee pleaded guilty in connection with three residential burglaries from last year. Authorities had started the first of three scheduled trials against him Monday, and just before closing arguments were to begin Wednesday, Lee pleaded guilty to first-degree burglary and a theft scheme.

“The 11 minutes in the bathroom got him,” juror Vivian Hoyme said after court adjourned.

A surveillance image shows Marcus Antonio Lee leaving a 7-Eleven restroom after burglarizing a home in Gaithersburg. Lee was caught partly because of the time he spent in the restroom. (Courtesy State’s Attorney’s Office)

It was a twist in an otherwise serious matter for owners of at least 20 Montgomery County homes that were broken into last year, in many cases as the residents were asleep in the dead of night.

Authorities have called Lee, 20, a “one-man crime wave” who struck panic in the Germantown and Gaithersburg areas. They eventually charged Lee in four break-ins and one attempted break-in and noted a dramatic drop-off in nighttime burglaries in those areas’ occupied homes since he was locked up.

“When he was arrested, they all stopped,” said Capt. Luther Reynolds, who commands the police district that stretches across the northern part of Montgomery County.

Lee is expected to receive a sentence of seven to nine years in prison this month and could be eligible for parole within four years. As part of Lee’s plea deal, Montgomery prosecutors intend to drop their remaining charges against him.

Lee’s attorney, Jennifer Dayton, declined to comment after Wednesday’s proceedings.

Jurors were dismissed from duty Wednesday before getting a chance to render a verdict. In interviews, seven said they were leaning toward convicting Lee but were waiting for the trial’s conclusion to decide.

The time Lee spent in the convenience store’s restroom didn’t weigh heavily on the jurors’ thinking, they said, but it was a crucial part of the timeline Assistant State’s Attorney Stephen Chaikin put together — both for jurors in his opening statement Monday and for the judge Wednesday.

What also became clear Wednesday was how police were closing in on Lee even before he broke into the Gaithersburg home. He was on probation for another burglary and was a suspect in a number of similar cases, and police were beginning to put him under surveillance.

About 2 a.m. June 20, the owner of a home just north of Route 124 in Gaithersburg was awakened by her crying child, Chaikin said. She then heard a car — her dark blue Camry — leaving the driveway and called 911. Police came right away and told other officers to watch for the Camry.

Her husband was home, but he didn’t hear the intruders. “These young men who came into the home were quiet as a cat,” Chaikin said in court.

They also stole a laptop computer — which was near the woman’s bed — two wallets, an iPhone and about $600, according to Chaikin.

As the trial unfolded, the prosecutor showed jurors surveillance images from a 7-Eleven. Lee could be seen entering the store and appeared to be taking off a white glove. He purchased a Lipton Brisk Iced Tea; his accomplices bought Ga­tor­ade and pink lemonade. They returned to the Camry with their drinks.

“And this is going to sound strange,” Chaikin said Monday. “The defendant, Marcus Lee, had to use the bathroom. That’s what got him caught. He goes back into the 7-Eleven.”

When police searched the car, they found items from the home where the Camry had been.

Dayton noted in her opening statement Monday that no one could actually place her client in the house.

“Marcus Lee, as we all are at some point in our lives, was at the wrong place at the wrong time,” she said.

Chaikin continued the narrative Wednesday.

“That 11-minute period is when the police come,” Chaikin said. It also helped Lee temporarily: When he saw police outside the 7-Eleven, he slipped away. Travis Forbes and a juvenile, however, were caught, and police arrested Lee about 10 hours later.

Hoyme, the juror, said that while she was leaning toward convicting Lee, the bathroom break gave her pause.

“It made me wonder: ‘Why is he so relaxed?’ ” she said. “I wouldn’t have been able to go to the bathroom for two weeks if I had done something like that.”

Forbes earlier pleaded guilty to conspiracy to commit a theft scheme in the case, according to prosecutors and court records. He is scheduled to be sentenced at the end of January. Forbes’s attorney, David Moyse, said Wednesday that his client never went inside the house where the Camry was parked.