Investigators spoke to hundreds of people in the search for clues about Mollie Tibbetts’ disappearance, but weeks after she vanished it was security camera footage that finally gave them a first glimpse of the man accused of killing her.

The 20-year-old student went missing on July 18 in Brooklyn, Iowa, after going for a jog. Authorities charged Cristhian Bahena Rivera, 24, with first-degree murder charges on Tuesday.

Here’s how investigators arrested Rivera and how they found a body believed to be that of Tibbetts.

They were caught on home surveillance

Her whole family, her hometown and dozens of investigators joined forces looking for the University of Iowa student. They put Tibbetts’ photo on yard signs, store windows and thousands of shirts around Brooklyn, a small community an hour east of Des Moines.

As the weeks passed, a reward for information on her whereabouts kept growing and reached nearly $400,000. Investigators got thousands of tips, rolled out an interactive website to help jog the public’s memory, and even looked into Tibbetts’ data from a fitness tracker.

They watched the footage for hours before they could spot Tibbetts, said Rick Rahn, a special agent in charge at the Iowa Division of Criminal Investigation.

The footage showed her running through an area east of Brooklyn and a car moving close to her. The black Chevy Malibu drove back and forth numerous times before it just started following her, according to an affidavit.

They linked the car to Rivera and “from that we were able to track his pattern in the routes in which he took,” Rahn said.

He didn’t resist when authorities tried to detain him on Monday, Rahn said.

Tibbetts ran off and suspect chased her, authorities say

After his arrest, Rivera told authorities he saw Tibbetts running and “pursued her in his vehicle.” Later, he parked the car and started running near her.

“And then, at one point, he tells us that Mollie grabbed ahold of her phone and said, ‘You need to leave me alone. I’m going to call the police.’ And then, she took off running and he, in turn, chased her down,” Rahn said during a news conference on Tuesday.

Rivera says that at some point, he panicked, got mad and doesn’t remember what happened next, according to the affidavit.

The next thing he remembers is being at an intersection in rural Poweshiek County and driving to a cornfield, court documents say.

When he noticed an earpiece from headphones on his lap, he realized he had put the woman in the trunk of his car. When he went to get her out of the trunk, he “noticed blood on the side of her head,” according to the affidavit.

A body covered in corn leaves is found

On Tuesday, Rivera led authorities to a body hidden in a cornfield near Brooklyn, officials say.