Two cups of coffee ended life on the run for an Internet sensation known as Kai the hatchet-wielding hitchhiker.

An employee at a Starbucks in Philadelphia is credited with recognizing 24-year-old Caleb "Kai" McGillvary, whose fledgling celebrity took a turn toward notoriety when authorities announced this week that he was wanted in the beating death of a New Jersey lawyer three times his age.

The unlikely pair met amid the neon lights of New York City's Times Square over the weekend and headed back to the squat brick home of 73-year-old Joseph Galfy Jr. on a quiet cul-de-sac in suburban Clark, N.J., authorities say. On Monday, Galfy was found beaten to death in his bedroom, wearing only his socks and underwear. McGillvary was arrested Thursday shortly after leaving the Starbucks and charged with killing Galfy.

McGillvary gained a measure of fame in February after intervening in an attack on a California utility worker. In an interview viewed millions of times online, he described using a hatchet he was carrying to repeatedly hit a man who had struck a worker with his car, fending off a further attack, and thus became known as "Kai the hatchet-wielding hitchhiker."

Galfy's funeral was held Friday in a small stone chapel in Warren, N.J. He was buried in East Hanover.

Galfy was an "excellent land use attorney," said friend Robert Ellenport. He said Galfy loved to travel and was a fan of the New York Giants and the Seton Hall University basketball team. Galfy would fly to warmer climes to watch Seton Hall play its first games of the season and was urging Ellenport and his partner to travel to Bali, one of Galfy's favorite vacation spots.

The victim's sister-in-law, Diane Galfy, said at her home that "he was a very well-respected man. That's what we want people to know," she said. She said her husband didn't want to talk and her children were devastated.

Galfy was a respected lawyer who in recent years handled land use and domestic violence cases, according to Union County Prosecutor Theodore Romankow, whose office is prosecuting McGillvary. The two knew each other through legal circles.

"He was just a nice man, a gentle man, well-regarded in the community," Romankow said.

In addition to his law practice, Galfy was the attorney for the planning board in Green Brook, N.J., and played drums in a wedding band.

Authorities said McGillvary was arrested Thursday evening after he walked into a Starbucks near a bus station in downtown Philadelphia and ordered two coffees. The woman who served McGillvary recognized him and alerted her manager, who called the police.

McGillvary took off before police arrived, Philadelphia Police Commissioner Charles Ramsey said, and without his coffee. But an officer went to a nearby bus terminal and found McGillvary, who was arrested there.

"He wasn't lying low," Romankow said. "He was out there."

McGillvary was arraigned Friday and being held without bail on charges in Galfy's killing, though a court official said he has a U.S. Immigrations and Customs Enforcement detainer for three arrests in Canada in recent years. ICE officials did not immediately return a request to confirm the detainer. It's not clear whether McGillvary would be deported rather than sent to New Jersey to face prosecution in Galfy's death.

Romankow said that McGillvary, who said in his TV appearance he prefers to be called "home-free" instead of homeless, traded on his newfound prominence to meet fans across the country.

Those fans include Terry Ratliff, 32, of Kingsland, Ga., who said he spoke to McGillvary a few times recently about working on music with him. Ratliff said he made about $70 from a YouTube video featuring McGillvary and sent him $34 on May 8. Ratliff said McGillvary was in New York at the time.

The two haven't met, but Ratliff started a fund for McGillvary's legal defense that has only raised $66 so far. It's not clear whether McGillvary has a lawyer, and the public defender's office in Philadelphia had no record of him.

"If he is telling the truth, then maybe better legal representation will help get that truth out," Ratliff said.

McGillvary has made statements before, though, that don't add up.

He has said he is from Sophia, W.Va., but Mayor Danny Barr said Friday that he and the fire chief know everyone in the town of 1,334, have never heard of him and found nothing about him in town records.

McGillvary also wrote statements on Facebook following Galfy's death that were "sexual in nature," Romankow said, and noted that they could have been self-serving.

McGillvary's last post, dated Tuesday, asks "what would you do?" if you awoke in a stranger's house and found you'd been drugged and sexually assaulted. One commenter suggests hitting him with a hatchet, and McGillvary's final comment on the post says, "I like your idea."

Ratliff says he is the commenter McGillvary was responding to. He said he had sent McGillvary an email the night before the post saying he had a song idea for him. Ratliff says when McGillvary responded with "I like your idea," on Facebook, Ratliff wasn't sure if McGillvary was referring to his email about music or suggestion to beat up the man.

It was a hatchet that helped give McGillvary a brief taste of fame in February when he gave a rambling, profanity-laced interview to a Fresno, Calif., television station about thwarting an unprovoked attack on a Pacific Gas & Electric employee. The interview went viral, with one version viewed more than 3.9 million times on YouTube. McGillvary later traveled to Los Angeles to appear on ABC's "Jimmy Kimmel Live!"

Noting that his photo had been all over, Ramsey said it apparently wasn't difficult to recognize McGillvary.

"Being on YouTube too much," the police commissioner said, "is not always a good thing."