MARTINEZ — A man suspected of gunning down his ex-girlfriend outside a Walnut Creek park was taken into custody Friday afternoon after keeping police at bay for 19 hours during a drug-fueled standoff.

Gregory Prokopowicz allegedly shot Roselyn Policarpio multiple times in Walnut Creek on Thursday afternoon near the Lindsay Wildlife Experience. Police said the 47-year-old victim lived in Martinez and Stockton.

Policarpio, originally from the Philippines, previously worked as a human resources coordinator. Her Klout profile page listed her interests as cats, Christianity, Twitter and Yorkshire. On Friday, it appeared that someone had changed Policarpio’s LinkedIn profile to include derogatory language.

Prokopowicz, who had spent the night parked outside a condominium complex near Highway 4, surrendered about 2:10 p.m. after police fired tear gas rounds into his silver Mercedes sedan, according to Walnut Creek police Lt. Tom Cashion.

Officers immediately surrounded the 38-year-old suspect and took him to a local hospital where he was being treated for minor injuries, police said.

Click here if you’re having trouble viewing this photo gallery on your mobile device.

For much of Thursday night and into Friday afternoon, parts of Center Avenue and Howe Road near the Tower Mart and Chevron station were blocked off to residents and traffic while SWAT team members tried to convince Prokopowicz to surrender.

Prokopowicz could be seen periodically pointing a gun to his head overnight and police said he threatened to kill himself. About five hours into the standoff, he accidentally shot through the windshield of the Mercedes, but no one was harmed, according to police.

Neighbors of the condominium complex reported hearing police negotiators telling Prokopowicz to put the gun down, and “No one else has to get hurt here today.”

Police believe Prokopowicz was taking drugs and hallucinating which derailed the negotiations around midnight Friday. The Contra Costa Sheriff’s SWAT team took over about 2 a.m. and continued negotiating with Prokopowicz until late morning, when the Central County SWAT team resumed control of the operation.

About an hour before Prokopowicz surrendered, it appeared the standoff had come to an end when he emerged from the Mercedes with his hands in the air to get a bottle of water. When the suspect suddenly turned to get back into the car on the passenger side, an officer shot “less-than-lethal” sponge rounds at him striking him in the ribs, Cashion said.

Prokopowicz threatened to kill a negotiator as the talks dragged on into the early afternoon, according to police. Eventually, Prokopowicz threw his gun and a knife out of the car window. The Walnut Creek bomb squad used a robot to retrieve the firearm. But officers could see a second knife in the suspect’s hand. When he refused to follow directions, police launched three rounds of tear gas into the Mercedes and Prokopowicz quickly got out with his hands up, Cashion said.

“The negotiations went on around 19 hours with him and some might ask why so long and the reason is preservation of life, we’re here to preserve everyone’s life no matter what they do,” Cashion said. “We want to get him in custody with no one injured or hurt or killed.”

Police using a robot to get a bottle of water to man they are trying 2get2surrender in Martinez. He's wanted 4murder. pic.twitter.com/j1MucQXrcW — Amy Hollyfield (@amyhollyfield) April 28, 2017

Cashion said Prokopowicz is known to law enforcement, but he did not elaborate. However, court records and neighbors paint a picture of a troubled man.

In February, Prokopowicz’s mother and stepfather applied for a restraining order against him citing drunkenness, credit card fraud and loud, threatening behavior. The application further alleges he kicked in a bedroom door at the family’s Morello Court home, not far from the standoff location.

“Gregory Prokopowicz is intimidating and loudly abusive to his mother and myself,” his stepfather wrote on the application. A judge granted the restraining order March 24.

Police believe Prokopowicz also lived part-time in a house in the 1800 block of San Luis Road in Walnut Creek, where police dogs tracked him after the fatal shooting.

According to a neighbor, Prokopowicz and a woman lived in the house and had a volatile relationship.

“It was never a good situation,” said Boris Breckinridge, who said he had not seen Prokopowicz for about five years until Thursday. “Things would be super quiet and all of a sudden, cops would be there.”

Breckinridge said that Prokopowicz was cordial to him, but seemed like a troublemaker and that there was always something strange about him.

Police received reports about 1:30 p.m. Thursday that a woman had been shot multiple times on the street in the 1900 block of First Avenue in Walnut Creek. Officers arrived in about two minutes, and they and other first responders worked unsuccessfully to save Policarpio’s life. She was pronounced dead at the scene.

Prokopowicz fled the scene in a silver four-door Chevrolet which he abandoned in a driveway on Lynvale Lane, a short street off Buena Vista Avenue south of the wildlife museum. Police believe he then ran through backyards and climbed over a fence to reach his house on San Luis Road.

At about 6:30 p.m., the Central County regional SWAT team, made up of officers from the Walnut Creek, San Ramon, Pleasant Hill, Martinez and BART police departments, assembled on San Luis Road where they interviewed several witnesses and canvassed the neighborhood.

Cashion said police searched the house for evidence, but he did not believe anything of significance was found. Nearby residents were told to stay indoors while the search was conducted. Police dogs and a California Highway Patrol helicopter also aided in the search effort.

But Prokopowicz and a friend had already left the neighborhood in the Mercedes and ended up near the suspect’s Martinez home, where two Walnut Creek police officers spotted the pair near Arnold Drive. Those officers and a Martinez police officer pulled over the Mercedes, initiating the standoff at 6:55 p.m. The friend, whom police did not identify, cooperated with authorities and was interviewed and released Thursday evening.

Early Friday morning, the Martinez Unified School District sent an advisory that nearby John Muir Elementary School would be closed for the day.

“As you likely know, there is a tense situation just around the corner from John Muir Elementary. This situation is ongoing and has been in place since yesterday evening,” superintendent C.J. Cammack said.

Some residents at the condominium complex were trapped there during standoff, ordered by police to stay indoors for their own safety.

Elizabeth Cheeks said Friday morning her daughter had been stuck in her garage with her dog all night, because it doesn’t open to the house and police wouldn’t let her come out.

“I feel upset right now,” Cheeks said. “I feel bad for her to be in lockdown.”

On Friday morning, a woman dropped off flowers outside the Lindsay museum as a memorial for Policarpio.

“I just felt the need,” said the woman who asked to be identified as a resident of the neighborhood. “I just wanted to show a little respect for someone who had such a violent death. I just wanted to say a little prayer for her.”

The last homicide in Walnut Creek occurred Aug. 27, 2016, when a 38-year-old man was shot near Crogan’s Bar on Locust Street.

Staff writers Malaika Fraley, Nate Gartrell and Matthias Gafni contributed to this story.