Police say a Pittsburgh man who shouted to them that he wasn’t “going back to jail” as he led officers on a slow, 5-mile foot pursuit on the frozen Allegheny River on Wednesday is — in fact — back in jail.

Gary Cawley, 47, is facing felony charges of burglary and criminal trespassing as well as misdemeanor possession of an instrument of crime, evading arrest on foot, railroad interference and disorderly conduct.

Pittsburgh police said they were initially dispatched at 1 p.m. to the 7100 block of Highland Drive for a report of a person trespassing on the former Veterans Administration hospital site.

The site sits atop a hill in Pittsburgh’s Lincoln-Lemington neighborhood above Washington and Allegheny River boulevards.

Inside the property, police found Cawley tampering with an electrical panel, according to a criminal complaint filed against him. Cawley instantly fled from officers over a fence and through a snowy ravine, the complaint said.

Officers initially halted their pursuit when they encountered a sheer 30-foot drop covered in ice, but they later tracked Cawley’s footprints to the riverbank, the complaint said. There, police observed him trekking atop the frozen Allegheny.

Walking along railroad tracks to monitor Cawley, officers ended up having to tell the railroad company to halt operations until Cawley was taken into custody, according to the complaint.

Though he was headed in the opposite direction, Cawley told police he’d “walk all the way to Mississippi,” before coming back to shore, the complaint said.

He also said, “It was only trespassing. I’m not going back to jail. Just send me a citation,” police said.

Cawley eventually diverted onto frozen Deer Creek in Harmar around 4 p.m., where an officer stepped onto the ice and arrested him, the complaint said.

City police said that was near the 2600 block of Freeport Road — more than 5 miles from where the pursuit had begun.

Temperatures didn’t rise above 15 degrees on Wednesday, and Cawley was transported to a local hospital for treatment. Police said he was in stable condition.

Since 1998, Cawley has pleaded guilty to burglary, criminal trespass and related charges several times, serving short stints in prison, according to court documents.

His preliminary hearing on the latest charges is set for Feb. 5. He was unable to post his $100,000 bond and remains in Allegheny County Jail.

Pittsburgh EMS River Rescue and police departments from Aspinwall, O’Hara, Oakmont, Harmar and Verona as well as the Allegheny County Sheriff’s Office and state police were involved in the pursuit.