PORTSMOUTH, Va. (WAVY) — A teenage burglary suspect who was shot by a Portsmouth police officer last October pleaded guilty to five felonies Tuesday, including armed burglary.

Deontrace Ward, 19, pleaded guilty to armed burglary, grand larceny, conspiracy to commit armed burglary, conspiracy to commit larceny and possession of a firearm by a convicted felony in Portsmouth Circuit Court.

Portsmouth Judge Kenneth R. Melvin sentenced Ward to 31 years in prison with 25 years suspended, leaving Ward to serve six years before he is released.

RELATED: Bodycam video shows burglary suspect shot by officer

Upon his release, Ward will have 10 years of supervised probation.

The decision comes as the result of a plea agreement, in which three charges against Ward were nolle prossed: Assault of a law enforcement officer, brandishing a firearm and destruction of property.

The charges stem from the Oct. 29, 2017 burglary of a home on Tatem Avenue. Ward and another person went into the home while its owners were at church, said André Wiggins, a special prosecutor from Suffolk.

Neighbors called police after hearing noises coming from the locked home.

When police arrived, Ward tried to escape on foot. He was shot by Portsmouth Police Officer Jeremy Durocher. Police body camera footage shows Durocher say that he believed Ward was armed. When police searched the teenager, they found a gun inside his pants near his knee, as well as jewelry, Wiggins said.

Wiggins said that about $1,500 in goods were stolen from the house. Two entry ways into the home were also damaged during the burglary, and investigators found a gun that was left behind on the scene.