Lots of robbers brandish handguns when committing their crimes.

Thomas A. Hubbard went a bit further — he also displayed a fake pipe bomb when he tried to rob a sub and pizza shop in Upper Marlboro.

Hubbard, 52, of Lothian, pleaded guilty Monday in the attempted armed robbery of the eatery in the 5700 block of Crain Highway, said Maryland U.S. Attorney Rod J. Rosenstein.

The botched crime took place on Feb. 25, 2010, authorities said.

According to Hubbard’s plea agreement, he wore a mask and carried a semi-automatic handgun into the sub and pizza place. Hubbard also displayed a piece of steel pipe that was capped at both ends, according to the plea deal. A cellphone was wired to the pipe to make it look like a pipe bomb, authorities said.

“Hubbard brandished the gun at the store manager and threatened to detonate the bomb unless the manager and the store owner, who had come out from the back after hearing the commotion, filled a plastic bag with all the money in the restaurant,” according to a press release issued by the U.S. Attorney’s office.

While the owner was following Hubbard’s orders to open the safe, he saw that Hubbard was looking away from him, and had the gun lowered, according to the press release. The owner jumped on Hubbard and hit him; Hubbard dropped the gun and tried to escape while the store owner and manager tried to keep him in place.

Prince George’s police arrived, and Hubbard was arrested, the press statement said.

Hubbard faces a maximum of 20 years in prison for the attempted robbery and a mandatory seven years, and a possible term of life in prison, for possessing and brandishing a firearm in furtherance of a crime of violence, prosecutors said.

U.S. District Judge Roger W. Titus scheduled sentencing for Feb. 13.