A 22-year old Los Angeles man was arrested on suspicion of 18 felony charges, including the human trafficking of a minor, kidnapping for child molestation and other sex assault charges related to the disappearance of a 13-year-old Mendocino County girl who was found in San Francisco over the weekend, officials said Tuesday.

King John Baylon was booked in San Francisco Jail early Monday following a dramatic search and recovery of the missing teen in a case that captured widespread attention on social media.

UCSF police found the girl at the Ferry Building on Sunday evening with Baylon, officials said. Local citizens had seen the missing girl’s photo and reported her whereabouts to officers, UCSF police said. Baylon was arrested at the scene.

The girl, a Fort Bragg resident, was visiting UCSF’s Mission Bay campus on Friday, where a sibling was receiving medical treatment.

Mendocino County Sheriff Office officials said the girl was seen on surveillance video leaving the hospital at about 3:30 p.m. with a younger man in his early-20s. Authorities said she might have known the man through the internet. Police did not say if the man was Baylon.

Her family shared her picture on social media, asking the public for help locating her and the post soon went viral.

The girl was later spotted at a nearby restaurant with someone matching the man’s description. A waitress called police after learning the girl was missing, authorities said.

Baylon was booked on suspicion of possession or control of child pornography, using a minor for sex acts, sexual intercourse with an underaged person, meeting a minor for lewd purposes, arranging a meeting with a minor for lewd purposes, contact with a minor for sexual offense, lewd acts upon a child, human trafficking involving a minor, kidnapping to commit another crime, kidnapping for child molesting, and oral copulation of a person under 18.

Evan Sernoffsky is a San Francisco Chronicle staff writer. Email: esernoffsky@sfchronicle.com Twitter: @EvanSernoffsky