A Hempstead man pleaded guilty Thursday in federal court in Central Islip to the gunpoint robbery of 15 stores on Long Island in a four-month period.

James Rogers, 47, admitted to committing the robberies between August and December of 2015, telling U.S. District Judge Joseph Bianco: “I got a gun . . . but I never intended to hurt anyone.”

Officials said the gun was not discharged during robberies. But on at least one occasion he told store employees not to do anything while he ran off, saying to “wait 10 minutes or I’ll kill you,” according to court papers.

Eastern District federal prosecutor Charles Rose said Rogers took in more than $20,000 during his spree.

As part of a plea deal, Rogers pleaded guilty only to two counts — conspiracy to interfere with interstate commerce by robbery and using a firearm during the robbery of $1,961 from a Petco store in Hicksville on Aug. 20, 2015, according to court records.

Rogers could theoretically face up to life in prison when he is sentenced, but has no right to appeal if he is sentenced to 209 months or less, under the plea deal.

advertisement | advertise on newsday

Nassau and Suffolk police pursued the pattern robber along with federal agents, launching an intensive search.

Rogers committed robberies in 11 communities on Long Island, officials said.

The robber entered commercial stores “at or near the opening or closing time, including Petco, Dollar Tree, Rainbow, Pier One and Babies R Us, with his face covered, brandished a black handgun, threatened employees and restrained them using toy handcuffs or plastic zip-tie restraints,” court papers said.

In many of the crimes, he took money and jewelry from employees and customers and put them in a pillow case and fled, the court papers said. The robber was described as a male, about 6 feet tall wearing a dark hooded sweatshirt, black pants, dark shoes and a black and white baseball cap.

Law enforcement authorities were led to Rogers when an unidentified woman co-conspirator admitted to investigators that she acted as the getaway driver in most of the robberies, court papers said.

“Addressing violent crimes that terrorize our neighborhoods and jeopardize the safety of our citizens is a priority, and the defendant will now be held accountable for his actions,” stated acting Eastern District U.S. Attorney Bridget Rohde, who also thanked the Drug Enforcement Administration for helping with the case.

The lead investigator on the case was a Suffolk County police detective assigned to the DEA’s Long Island Drug Task Force, according to court papers.

Rose declined to comment afterward as did Rogers’ attorney, federal public defender LaKeytria Felder.