Police have taken into custody a suspect whom they believe is connected to a recent robbery spree that targeted more than two dozen businesses in Queens and Long Island.

Police captured the man, who has not been publicly identified, following a Floral Park manhunt after he was spotted running through a neighborhood on Wednesday, NBC4 reported. Law enforcement’s extensive search for the knife-wielding suspect included help from the FBI and lasted several months as he continued to rob area businesses.

RELATED:  Serial Queens restaurant robber strikes again

Around 10:13 p.m. on Tuesday, the suspect allegedly attempted to rob a Dollar Tree on 14th Avenue in Whitestone, Queens, but his effort was unsuccessful as he left with nothing, ABC7 added. Following the failed attempt, a woman questioned in connection to the incident was able to identify the suspect.

"He walks in, produces what looks like a large butcher knife that he uses on each one," NYPD Chief of Detectives Robert Boyce said to ABC7. "He puts it back in his pants leg when he leaves."

The suspect left the Dollar Tree after the failed attempt in a gray vehicle that matched a car used in at least one of the other 24 robberies that he allegedly committed, NBC4 added.

RELATED: Man targeting elderly women in violent robbery spree: NYPD

"Only 30 percent of robberies get solved nationwide. Seventy percent of them get away with it," Joseph Giacalone, a retired NYPD sergeant and adjunct professor at John Jay College, told ABC7. "I don't think the public really understands how hard robberies are to solve."

Recently, the suspect was believed to be responsible for a robbery at a Subway restaurant in Forest Hills on Friday, another Subway in Oakland Gardens on Sunday and yet another Subway in Rockaway Beach on Monday, according to NBC4.