The Cleveland man accused of holding three women captive in his home for a decade entered a guilty plea on Friday in order to avoid the death penalty.

The man, Ariel Castro, 53, pleaded guilty to 937 counts, including rape and kidnapping, in a plea agreement with prosecutors. Under the deal, he would spend life in prison without parole and receive 1,000 additional years.

“I will plead guilty because of the plea deal,” Mr. Castro said in court.

In a hearing on Friday, Judge Michael J. Russo of Cuyahoga County Common Pleas Court reviewed the charges and asked Mr. Castro whether he understood that he would not leave prison before he died. Mr. Castro said that he understood.

The hearing, which lasted more than an hour, was the first time the public had heard from Mr. Castro at length since he was arrested in May. Mr. Castro, who wore an orange jumpsuit and glasses and had a thick beard, often went beyond the judge’s questions, bringing up his “sexual problems” and saying that he missed his daughter.