WASHINGTON — In the hours before his arrest, as federal authorities zeroed in and secretly accumulated evidence, Cesar Sayoc was in his element: spinning classic and Top 40 hits in a nightclub where he'd found work as a DJ.

As he entertained patrons from a dimly lit booth overlooking a stage at the Ultra Gentlemen's Club, where Halloween decorations hung in anticipation of a costume party, he could not have known that investigators that very evening were capitalizing on his own mistakes to build a case against him.

He almost certainly had no idea that lab technicians had linked DNA on two pipe bomb packages he was accused of sending to prominent Democrats to a sample previously collected by Florida state authorities. Or that a fingerprint match had turned up on a separate mailing that authorities say he sent.

And he was probably unaware that investigators scouring his social media accounts had found the same spelling mistakes on his online posts — "Hilary" Clinton, Debbie Wasserman "Shultz" — as on the mailings he'd soon be charged with sending.

In the end, prosecutors who charged Sayoc with five federal crimes Friday say the fervent supporter of President Donald Trump unwittingly left behind a wealth of clues, affording them a critical break in a coast-to-coast investigation into pipe bomb mailings that spread fear of election-season violence. The bubble-wrapped manila envelopes, addressed to Democrats such as Barack Obama and Hillary Clinton and intercepted from Delaware to California, held vital forensic evidence that investigators say they leveraged to arrest Sayoc four days after the investigation started.

"Criminals make mistakes so the more opportunities that law enforcement has to detect them, the greater chance they're going to be able to act on that, and that appears to be what happened here," said former Justice Department prosecutor Aloke Chakravarty, who prosecuted the Boston Marathon bombing case.

But it wasn't always clear that such a break would come, at least not on Monday when the first package arrived: a pipe bomb delivered via mail to an estate in Bedford, New York, belonging to billionaire liberal activist George Soros. That same day, Sayoc, still under the radar of law enforcement, retweeted a post saying, "The world is waking up to the horrors of George Soros."

Additional packages followed, delivered the next day for Clinton and Obama and after that to the cable network CNN, former Attorney General Eric Holder, former Vice President Joe Biden and other Democratic targets of conservative ire.

Each additional delivery created more unease. But together they also provided more leads for the FBI, which mined each pipe bomb for clues at a laboratory in Quantico, Virginia.

As the packages rolled in, technicians hit a breakthrough: a fingerprint and DNA left on a package sent to Rep. Maxine Waters, a California Democrat and one of the intended pipe bomb recipients, and DNA on a piece of pipe bomb intended for Obama. The FBI said it had identified no other possible matches on the evidence it had examined.

Besides that, the FBI said, his social media posts that traffic in online conspiracy theories, parody accounts and name-calling include some of the same misspellings as were noticed on the 13 packages he was charged with sending.

The clues, authorities say, led them to a 56-year-old man with a long criminal history who'd previously filed for bankruptcy and appeared to be living in his van, showering on the beach or at a local fitness center.

Cesar Sayoc's van is seen in Boca Raton, Florida, on Oct. 18, 2018 in this picture obtained from social media. Ed Kennedy / via Reuters

As the FBI worked around the clock, and as Americans were busy debating the hard-edged political climate and whether Trump had fanned the flames with his rhetoric, it was business as usual for Sayoc as he took to Twitter to denigrate targets like Soros. That was not uncommon for the amateur body builder and former stripper whose social media accounts are peppered with memes supporting Trump and posts vilifying Democrats.

On Thursday from noon to 9 p.m. as law enforcement grew ever closer, descending on a postal sorting facility in Opa-locka, Florida, Sayoc was working as a disc jockey at a West Palm Beach nightclub where he'd found work in the last two months. There, he spun his music from inside a small dimly lit booth overlooking a stage with performers dancing below. Autographed photos of scantily clad and nude adult entertainers were plastered across the walls like wallpaper.

"I didn't know this guy was mad crazy like this," said Stacy Saccal, the club's manager. "Never once did he speak politics. This is a bar. We don't talk politics or religion in a bar, you know?"

But Scott Meigs, another DJ at the club, had a different experience.

He said Sayoc had been talking about politics to everybody at the club for the last two weeks, preaching the need to elect Republicans during the November elections. "I just figured he was passionate about the upcoming elections."

The next morning, he was taken into custody near an auto parts store in Plantation, Florida, north of Miami. Across the street, Thomas Fiori, a former federal law enforcement officer, said he saw about 50 armed officers swarm a man standing outside a white van with windows plastered with stickers supporting Trump and criticizing media outlets including CNN.

They ordered him to the ground, Fiori said, and he did not resist.

"He had that look of, 'I'm done, I surrender,'" Fiori said.