SAN FRANCISCO (CBS SF) — A San Francisco man has been found guilty in San Francisco County Superior Court of stalking and domestic violence, having been accused of using a GPS tracking device to stalk his former boyfriend and follow him, District Attorney George Gascon announced Monday.

According to prosecutors, Joshua Elliott, 45, of San Francisco used a GPS device to stalk his former boyfriend and then sent him a series of threatening texts.

READ MORE: Curry Scores 23, Warriors Top Thunder To Remain Unbeaten, 106-98

A jury returned its verdict Friday afternoon after five hours of deliberation.

According to prosecutors, Joshua Elliott, 45, had dated and lived with the victim for two months in 2017. However, the victim ended the relationship after he noticed increasingly possessive and controlling behavior by Elliott, Gascon said in a statement.

In December 2017, Elliott purchased a GPS tracking device and attached it to the victim’s vehicle, unbeknownst to the victim. Then in early January, Elliott sent a text message to the victim suggesting he knew where the victim was.

On Jan. 17, the victim was leaving Zuckerberg San Francisco General Hospital around 2 a.m. when Elliott texted him. At the same time, the victim noticed that Elliott was driving by slowly and staring at him outside the hospital.

About a week later, at his home in San Pablo, the victim went out to walk his dog along with a friend. They found Elliott sitting nearby, and Elliott then confronted the victim, insisting that if the victim didn’t do as Elliott told him, things were going to “get worse” for the victim, prosecutors said.

In another instance, on Feb. 16, the victim was driving across the Bay Bridge when he noticed a car driving at the same speed next to him. The victim realized the other driver was Elliott. Although the victim took a detour to avoid Elliott, when he arrived at work, Elliott was in parking lot waiting for him. Elliott then approached the victim and tried to stop him from entering his work, telling him that he “won’t be doing this everyday.”

When the victim asked what Elliott meant by that, he said that the victim would not be “getting up everyday” after that.

Elliott then realized that the victim was recording the confrontation with his cellphone, and when Elliott tried to take the victim’s phone a struggle ensued. A bystander intervened, prompting Elliott to flee. The victim, who suffered minor injuries to his hand and back, contacted police immediately.

On Feb. 20, while the victim was at the Hall of Justice in San Francisco giving a follow-up statement to police regarding the Feb. 16 incident, Elliott sent the victim a text message.

“What do you know? While meandering around the city, I happened to see your car by the courthouse. Could be a work coincidence,” Elliott’s message said.

On Feb. 23, the victim, convinced he was being followed, found a magnetic box – a SpyTec tracking device – stuck to the driver’s side rear wheel well of his car. The victim took photos of the device, but then placed it back onto his car, fearing what Elliott might do if he discovered the device was missing.

READ MORE: SJSU Commends Coach, Athletic Director For Exposing Sex Abuser In Women's Athletic Dept.

The next day, the victim drove to Georgetown in El Dorado County to visit his mother’s property. The suspect then texted the victim: “I don’t suppose I have to tell you how beautiful the property is.”

On Feb. 25, while still at his mother’s house, the victim noticed that the tracking device had been removed from his car.

Weeks later, on March 9, the victim received several text messages from Elliott saying, “today was the day,” and that the day marked a “turning point.” That same day, the victim noticed that the GPS tracking device has been put back onto his vehicle.

Terrified by what appeared to be threats, the victim again removed the GPS tracking device.

On March 21, the victim parked his car at his work’s parking lot and decided to sleep. The victim had been staying at work since the incidents with Elliott began, partly because he knew there were security cameras there.

While in his car, the victim noticed a car drive by without headlights on. The victim then pulled out of the parking lot and noticed that the vehicle without headlights on was Elliott’s.

As the victim called 911 to report Elliott, Elliott followed him. After following for two miles, the victim stopped to meet with officers who were dispatched to the scene.

Later that day, the victim again noticed Elliott in his car outside his work and again called police. Once again, Elliott fled.

Officers were eventually able to track him down and arrest him after obtaining a warrant.

Elliott had been tracking the victim using a geofence feature, which alerted him when the victim’s car approached certain locations – in this case, the victim’s mother’s home, the victim’s home, the victim’s workplace, the victim’s grandmother’s home and the victim’s friend’s home in Roseville, according to prosecutors.

“This victim was absolutely terrorized by his stalker; he was living in fear,” Gascon said in the statement. “I commend him for getting out of an abusive relationship, and I urge anyone living in fear to come forward and to contact authorities. We are here to help.”

“When a decision to end a relationship is met with threats, harassment and intimidation, that is criminal, and there will be consequences,” Assistant District Attorney Courtney Burris said in a statement.

MORE NEWS: UPDATE: Alameda County Supes Debate Proposed Oakland A's Stadium Financing

Elliott is set to be sentenced on Sept. 21.