A District man accused of posing as a Pepco worker during two Maryland home-invasion robberies in 2011 pleaded guilty to one of them Tuesday in Anne Arundel County.

Craig S. Brooks, 50, of Farragut Street NE pleaded guilty to first-degree assault on the day he was scheduled to go to trial in a robbery in May in which he tied up a Glen Burnie homeowner with duct tape and held a gun on her, said Kristin Fleckenstein, a spokeswoman for the Anne Arundel state’s attorney.

Brooks was sentenced to a mandatory 25 years in prison without parole, Fleckenstein said.

The Glen Burnie victim had reported the attack, providing a description of a lone assailant, but only recognized him as Brooks after Prince George’s County police released photos of him and another suspect in the death of a man shot in a home-invasion robbery in July in the Fairwood subdivision of Bowie.

According to Anne Arundel police accounts, the woman said Brooks knocked on her door on the morning of May 3 and said he was from Pepco to check on a gas leak before showing purported credentials.

Brooks went to the victim’s basement and asked for her help locating a fuse box, according to police. When she was downstairs, he pointed a gun at her and later tied her up while demanding any cash in the house.

Brooks took a photo of the bound woman with his cellphone and ransacked the house before fleeing, police said. The woman managed to remove the duct tape from her mouth and call out to her adult son, who was asleep in the house and freed her.

Brooks also allegedly posed as a Pepco worker in the Bowie case, in which he is scheduled to stand trial May 29 on first-degree murder and robbery charges, Prince George’s County court records show. In that arrest, his address is listed as District Heights, but he is the same man who pleaded guilty Tuesday in Anne Arundel, said John Erzen II, a spokesman for the Prince George’s state’s attorney.

In both cases, police contend that Brooks demanded money and appeared to know that someone in each of the houses ran cash-heavy businesses, according to police information filed with the two arrests.

In the Glen Burnie case, a woman who ran a catering-truck business frequently spent time at the house Brooks entered, police said.

In the Bowie case, the slain man was David W. Williams, 44, who owned a laundromat in Glenarden. According to police, Brooks and an alleged accomplice made off with buckets of coins and cash in that robbery

The second suspect in the Bowie case — John F. Haston, 46, of Clinton — is also scheduled for trial May 29 on murder and robbery charges, court records show.