The man suspected of fatally shooting a 74-year-old, randomly selected target and posting a video of the killing on Facebook committed suicide as police were closing in on him Tuesday, authorities said.

Steve W. Stephens — the subject of a nationwide manhunt after Sunday’s horrific slaying in Cleveland reignited a debate about violence in the Internet age — was spotted late Tuesday morning at a McDonald’s in Erie County, Pa.

A restaurant manager told the New York Times that drive-through employees recognized Stephens, phoned police and tried to delay him by holding up his french fries.

“He just took his nuggets and said, ‘I have to go,’” the manager said.

Pennsylvania State Police said they chased him from the McDonald’s for about two miles, finally ramming his car.

“The vehicle spun around — came to a stop,” police Maj. William Teper Jr. said at a news conference. “He immediately pulled a weapon out and shot himself in the car.”

Thus ended a desperate, rapidly expanding search that began Sunday — when a video on Stephens’s Facebook page appeared to show him gunning down Robert Godwin Sr. for no apparent reason.

“We have our closure,” Cleveland Mayor Frank G. Jackson said at a news conference in Ohio.

But Cleveland Police Chief Calvin Williams probably spoke for many when he said moments later: “We have so many questions.”

Godwin was killed on Easter, as he walked alone down a residential road in east Cleveland, carrying a grocery bag.

He was reportedly collecting aluminum cans, though his family told CNN that he was walking home from a holiday meal when Stephens — 6-foot-1 and 224 pounds, according to police — approached with a cellphone camera.

“I found somebody I’m about to kill,” Stephens said in the live video. “He’s an old dude.”

There was little in Stephens’s history, as told by those who knew him, to suggest the violence he was about to document.

He had no criminal history. He had worked for many years at a children’s behavioral center in Ohio, where he had no red flags in his personnel file, according to the Erie Times-News.

A neighbor told CNN that he often stayed with his girlfriend and her children in a house outside Cleveland and that he was there two days before the killing, fixing the garage.

But Stephens’s mother told CNN that he’d bid her a cryptic farewell that weekend. He’d said that he was “mad at his girlfriend” and — in a phone call shortly before the killing — that he was “shooting people.”

Authorities say Stephens had never met Godwin before he pulled his Ford Fusion up beside him about 2 p.m.

Stephens approached Godwin. “Can you do me a favor?” Stephens said, as seen in the video. He asked Godwin to say the name “Joy Lane.”

“Yeah,” Stephens said. “She’s the reason why this is about to happen to you.”

Stephens then asked Godwin how old he was, raised a gun into the frame and pulled the trigger.

The camera spun around; when the picture came back into focus, Godwin was on the ground.

“I don’t think there’s any rhyme or reason for what happened,” the police chief, Williams, told reporters Monday. “I don’t think there’s anything we can point to specifically to say that this is what sparked this. Only Steve knows that.”

Stephens posted a subsequent video — on his cellphone, telling someone to watch the footage.

“I can’t talk to you right now. I f‑‑‑‑‑ up, man,” he says.

“Dog, I just snapped, dog,” Stephens adds in a video posted by Cleveland.com. “I just killed 13 motherf‑‑‑‑‑‑, man. That’s what I did — I killed 13 people. And I’m about to keep killing until they catch me, f‑‑‑ it. … I’m working on 14 as we speak.”

Police haven’t confirmed any other deaths linked to Stephens, and said they don’t think he had any accomplices.

“We had been in a relationship for several years,” Lane wrote to CBS News, according to the network. “I am sorry that all of this has happened … Steve really is a nice guy … He was kind and loving to me and my children.”

“This is something that should not have been shared around the world. Period,” Cleveland’s police chief said.

The case prompted Facebook to review how quickly and easily its users can report material that violates standards.

“We have more to do here, and we’re reminded of this this week by the tragedy in Cleveland,” Facebook CEO Mark Zuckerberg said at a developer conference Tuesday. “We will keep doing all we can to prevent tragedies like this from happening.”

Three men were shot last year in Norfolk while one was broadcasting live on the website. In 2015, a shooter killed a TV journalist and her cameraman during a live television broadcast before posting his own video of the killing on Facebook.

Other live platforms have been used to broadcast similar videos.

In tears on CNN Monday, one of Godwin’s daughters offered empathy for her father’s accused killer.

“Our father … taught us about God,” Tonya Godwin-Baines said. “How to fear God, how to love God and how to forgive.”

And so, she said, “each one of us forgives the killer, the murderer. We want to wrap our arms around him.”

Police just wanted to find him.

“Whether somebody was harboring him or he was under a bridge somewhere, we don’t know,” Teper, the Pennsylvania police commander, said when it was over.

Police said they were in contact with Stephens via cellphone early in the investigation, but his last known location before the encounter in Pennsylvania was the site where Godwin was killed.

Hundreds of reports of possible sightings started to pour in from across the country — at a hotel in Washington, for example — nearly all of them inaccurate.

As panic spread, the Cleveland police chief had to dispel false rumors that the city was on lockdown, Cleveland.com reported.

For nearly 48 hours, Stephens essentially vanished from sight — baffling authorities to the point that they began to speculate that he was dead.

“You’re going to see law enforcement activity who knows where,” FBI Special Agent Vicki Anderson told The Washington Post on Tuesday morning.

That same morning, about 100 miles from the balloon-covered fence that marked Godwin’s death, the crew at a McDonald’s in Harborcreek Township outside Erie were setting up for lunch.

The store owner told the Erie Times-News how a drive-through worker called him back, suspecting she’d just rung up nuggets and fries for one of the most wanted men in America.

“He got to the second window of the drive-through,” Thomas DuCharme Jr. said. “We told him he was waiting on his fries for a minute just to kind of buy some time for the cops if it actually was him. He said he had no time to wait, he had to go.”

It’s not clear what brought Stephens to Erie County. Police described the area as remote, rural and full of potential hiding places.

Cleveland.com reported that he’d posted to Facebook about extensive gambling losses at a casino nearby, and police told CNN that he was a regular patron.

In any case, Pennsylvania state police were on the trail of his Ford Fusion by 11 a.m.

At least four troopers gave chase, police said — for about two miles, no faster than 50 mph, until they neared an abandoned school.

One of the patrol cars nudged Stephens’s back wheel, causing it to spin out.

As officers approached, police said, the suspect took his own life.

“We would like to have brought in Steven peacefully and really talk to him and find out why this happened,” said Williams, the Cleveland police chief.

Not everyone thought so.

“All I can say is that I wish he had gone down in a hail of 100 bullets,” Godwin’s daughter Brenda Haymon told CNN.

Drew Harwell, Travis M. Andrews and Fred Barbash contributed to this report, which has been updated numerous times. An earlier version incorrectly identified the suspect’s license plate as well as the year Facebook launched its live-streaming feature.