UNION CITY >> When she met 34-year-old Roberto Reyes, 15-year-old Jane Doe didn’t have anything in the world but a sidewalk to sleep on and a pet dog she traveled around San Francisco with, searching for shelter, according to police.

After being introduced through a friend, Reyes offered to get the girl and her canine a motel room in Fremont, which she took as a sign her luck was about to change, authorities say.

But before long she came to learn she was being groomed by a Hayward man who told her she could bring in money by attracting “grown a— men,” as an underage — and unwilling — sex worker, authorities said in court records.

“U gonna be ready for tomorrow nite (sic) I already got a couple people that want a piece of u,” Reyes allegedly texted the girl during one exchange.

One of the first things Reyes did, according to Union City police, was separate the dog from Doe and threaten to kill her pet if she ran away. But after a four-day ordeal in which she says she was nearly raped by one of Reyes’ companions, Doe had to make a choice. With a woman’s help, she fled to police, leaving her dog behind, court records show.

Reyes allegedly threatened to kill the dog several times in subsequent text messages, telling her he would “put your dog down” if she didn’t return, police said. It’s unclear if he ever made good on the alleged threat. When Reyes was arrested on human trafficking charges, he claimed he gave the dog to another homeless person, court records show.

Reyes is now facing felony charges of human trafficking a minor and pandering by procuring, court records show. At his most recent court hearing held on Dec. 16, he postponed entering a plea until January, records show.

The charges stem from a four-day span beginning on Sept. 16, when Doe allegedly met Reyes through a female friend. After checking into a Fremont motel, Reyes took her shopping and out to dinner, she would later tell police.

Then Reyes allegedly informed her she was going to be “working” and getting visits from “grown a— men,” according to police. On Sept. 19, a friend of Reyes named Angel allegedly came to the hotel and fondled the girl during a sexual advance, but when she became upset and refused Angel, Reyes told her she was “excused,” according to police.

The girl told investigators that Reyes sexually abused her that same day, and that he told her repeatedly he “owned her” and that “she belonged to him,” police said in court filings.

On Sept, 20, Reyes took the girl to a restaurant and she went to the bathroom. Instead of returning, she waited inside, and approached a mother and her child who eventually entered. The good Samaritan was able to sneak Doe out of the restaurant and helped her call police, authorities said.

Reyes denied molesting or trafficking the girl, portraying himself as a do-gooder who wished to help an unsheltered person in need, according to police. He also mentioned that Doe claimed to be 19 and that he didn’t know her true age.

When police asked him about threats to kill her dog, he admitted to doing so but said it was because he was upset that she’d repaid his kindness by leaving him at the restaurant. The threats were backed up by texts that said, “I’m gonna put your (expletive) dog down if you don’t come back,” and, “It’s good, b—- that was the last time you see your dog,” according to police.

Reyes posted $250,000 bail in late October and has been out of custody ever since, court records show.