Christian Alexander Ortiz faces one count of murder. He is suspected of killing Brayan Rodriguez, 20, of Santa Clarita, whose body was found two days later in Ortiz's closet, authorities said.
Rodriguez had been reported missing and was found two days later. Authorities believe his cause of death was strangulation.
If Ortiz is convicted as charged, he faces a maximum sentence of 25 years to life in prison. His bail was set at $2 million.
His arraignment was continued to Nov. 16.