The incident happened shortly before midnight Friday at a home on Holloway Avenue near San Francisco State University, police said.
The suspect in the killing, Martin Martinez, of San Francisco, was arrested about two hours later, police said.
Police say Martinez stabbed 17-year-old Angelo Zuniga after an argument between the two escalated into a physical fight.
Zuniga, also a San Francisco resident, was stabbed multiple times in the chest, and later died at San Francisco General Hospital.
Martinez, who appeared in San Francisco Superior Court Wednesday, was ordered held on $1 million bail.
He has been charged with one count of murder with the use of a deadly weapon, according to the San Francisco District Attorney's Office. He has not yet entered a plea.
He is scheduled to return to court Nov. 12.