ROCKLAND, Maine — A Rockland man was sentenced Tuesday to 10 years in prison with all but four years suspended for a nighttime break-in at an apartment in which the resident shot him.

Christopher Wildhaber, 45, pleaded guilty Tuesday afternoon in Knox County Unified Court to burglary, attempting to steal drugs and refusing to submit to arrest.

Justice William Stokes told Wildhaber that he was fortunate the bullet that struck him did not hit a vital organ. The judge said nighttime burglaries are among the most serious crimes. Wildhaber will be on probation for three years upon his release.

The victim’s attorney issued a statement Tuesday on behalf of his client, Harvey Lembo, who shot Wildhaber during the Aug. 31, 2015, burglary at Park Place apartments in Rockland.

“This has been a difficult road for him as Mr. Wildhaber’s home invasion was the fifth time his home had been burglarized in five years. Mr. Lembo, who is physically disabled and largely confined to a wheelchair, was very concerned for his own physical safety in the face of these continued invasions of his home,” the statement from attorney David Weyrens of Portland said.

“On the night in question, Mr. Lembo, in his wheelchair, was terrified for his life when confronted by Mr. Wildhaber, who was totally unknown to him, standing in his living room in the middle of the night — his intentions unknown. Harvey is grateful there was no loss of life and wishes to thank the Rockland Police Department and the Knox County District Attorney for their efforts in prosecuting Mr. Wildhaber for his crimes that evening,” the statement concludes.

Wildhaber pleaded guilty through what is known as an Alford plea, in which he denies committing the offense but agrees the prosecution had enough evidence to convict.

Defense attorney William Pagnano told the court Wildhaber maintains he was intoxicated that evening and had simply gone into the wrong door at Park Place apartments, where his friend also lives.

During the probation revocation hearing last month, Wildhaber testified he was intoxicated and was returning to the apartment of a friend next to Lembo’s and simply went into the wrong place.

“I heard a pop and felt a burn,” Wildhaber said.

He denied talking to Lembo and said he ran out of the apartment but recalls little more.

Lembo, 68, called the public safety dispatch to say he had a gun pointed at a man who he found had broken into his home. He told the dispatcher he instructed the man to sit still or he would shoot him. The dispatcher told Lembo not to do that.

The dispatcher then loses contact with Lembo for about a minute before he comes back on the phone to say he shot the man and that there was blood everywhere in the apartment.

District Attorney Geoffrey Rushlau said last month he has not yet ruled out charging Lembo in connection with the shooting, under a state law that outlines when it is permissible to use deadly force in defense of premises.

After the shooting, Lembo received a notification from Stanford Management LLC of Portland, which manages the apartment complex, saying he was in violation of house rules by having a gun on the premises and that an eviction process would be started if he did not comply.

Lembo filed a lawsuit against the property’s owner, Park Place Associates of Rockland, and the management company, claiming they have violated his U.S. and state constitutional rights to own a gun. Justice William Stokes ruled against Lembo in that case, but gun rights advocates supporting Lembo have appealed the ruling to the Maine Supreme Judicial Court.

In response to some of the legal wrangling over gun and property rights that arose after the shooting, the Maine Legislature also passed legislation that prevents apartment owners who receive government subsidies from prohibiting their tenants owning guns. The law exempts owner-occupied buildings of four or fewer units