On August 23, Michael Dalipe, 37, was shot in the head and killed outside of Dublin's Emerald Park Apartments.
His wife heard the gunshots and found him outside, but the suspect was nowhere to be found.
RELATED: Suspect in Dublin shooting that killed 1 man arrested nearly 400 miles away, police say
"Based on social media, we were able to link our suspect 38-year-old Nicholas Paleveda, as having some sort of online conversation with our victim," Dublin Police Chief Nate Schmidt said. "From there, the investigation was off and we were trying to locate him."
Chief Schmidt says the suspect and victim knew each other from several different online platforms, including Discord, a popular site for gamers to communicate.
Less than 24 hours later, Paleveda was arrested in a Walmart parking lot almost 400 miles away in the small Southern California town of Barstow.
They believe he was on his way back home to Arizona.
"This is a very strange case for someone to drive all the way from Arizona to the city of Dublin and commit this type of a crime," Schmidt said. "In Dublin, we don't see these types of crimes here."
While Chief Schmidt says they are still confirming if the two parties had an argument, at this point, they still don't have the motive.
MORE: How Discord helped FBI thwart 13-year-old's synagogue mass shooting plot
"We know that they were associates on social media platforms, we just don't know what those conversations are yet, it takes time to go through those electronics to see what those conversations may be but that's something we're definitely looking into," he said.
Dalipe's wife Cynthia told ABC7 Michael "was a man who loved to cheer people up with humor and help friends in whatever way he could."
She says they met the suspect in person a few times more than 10 years ago at some gaming-related events.
But she didn't remember who he was.
"What's most troubling about this situation is the distance," Dr. Lisa Hill.
Dr. Hill is a criminal justice and social work professor at Cal State East Bay. She also works as a marriage and family therapist.
INTERACTIVE: Take a look at the ABC7 Neighborhood Safety Tracker
"Even during those hours that he was driving, even if he was speeding, it took him at least eight, nine hours maybe to get here, that didn't deescalate him, he was still driven unless there was some continued dialogue between him and the ultimate victim," Hill said.
Palevada was formally arraigned in an Alameda County courtroom on Thursday, facing charges of homicide as well as possession of a firearm.
He's being held without bail at the Santa Rita Jail and is expected to be back in court Sept. 12.
A GoFundMe has been set up to help his wife and family.