A man who admitted to robbing another man at knifepoint in his own home under the guise of a Craigslist transaction could face up to 40 years in prison.

David Mascarenas, 56, pleaded guilty in a Jefferson County court Monday to aggravated robbery, first degree burglary, motor vehicle theft, menacing, ID theft and false imprisonment.

Prosecutors say Mascarenas and David Martinez showed up at Anthony Mott’s Jefferson County home on Jan. 24, 2016.

When they were invited inside, they tied up Mott’s wrists and held a knife to his neck before taking wallets, purses and electronics from his home.

Prosecutors say when the two tried to steal Mott’s vehicle, he was able to break free and ran to the front porch, yelling for them to stop.

When he says he believed Martinez was about to shoot him, prosecutors say Mott fired his weapon, killing Martinez.

Jefferson County prosecutors declined to file charges against Mott, arguing that what occurred was self-defense.

Mascarenas was arrested two days after the robbery after the investigators learned he made multiple purchases with Mott’s credit cards.

Mascarenas is slated to be sentenced on Dec. 9.