Scott Holland, 44, agreed to a term of 50 years to life in state prison as part of the plea deal, and will be sentenced Dec. 12.
"We wanted to make sure we put this animal behind bars for the rest of his natural life," District Attorney George Gascon said at a news conference after this morning's court hearing.
Holland killed Horan, 46, the night of Oct. 29, 2010, after he posed as a utility worker to get into the building then knocked on her door.
Horan had just returned from a trip to Argentina with her mother earlier that day, Assistant District Attorney Michael Swart said.
Holland -- who later told police he was upset about his wages being garnished for child support and had set out that night to rape someone, high on methamphetamine -- knocked on several doors before he found an "unsuspecting, tired woman," Swart said.
Holland was initially also charged with attempted rape, robbery and burglary, but those charges were dropped as part of the plea agreement.
Horan was killed with a pry bar and a knife. Her body was found the next morning, and Holland was arrested Nov. 5, 2010, at Sutro Heights Park near Ocean Beach.
He had been released from prison earlier that year after serving 11 years of a 13-year sentence for attempted murder in Fresno County.
This morning, shackled and dressed in a red jail sweatshirt and pants, he politely replied to San Francisco Superior Court Judge James Collins' questions as Horan's family members wept quietly in the courtroom.
Lynn Jefferson, a friend and neighbor of Horan, spoke at the news conference as family members stood by. She said she would often run into Horan, who liked to spend time in the neighborhood and at Crissy Field.
"She was a beautiful, wonderful woman," Jefferson said. "And it's a great loss to everyone."
Swart said Holland lived in the 700 block of Vallejo Street in North Beach and may have chosen to target Horan's neighborhood simply because it was nearby.
Jefferson said his guilty plea has brought some peace.
"I feel very sad, but I feel happy that there was a plea and that this horrible monster will not see the light of day," she said.
Gascon said Holland agreed never to appeal the case.
Holland's attorney, Deputy Public Defender Rebecca Young, said outside of court that there was "overwhelming" evidence against her client and that he is remorseful.
"He wanted to accept his punishment," she said.