Two men with extensive criminal histories marched into a Bay Shore Capital One branch with their guns drawn on Wednesday and robbed the bank before leading police on a chase through two counties, a Suffolk prosecutor said in court Thursday.

Suspected getaway driver Kevin Highland, 35, of 115-34 142nd St., Jamaica, and his accused accomplice, Murray Hawkins, 35, of 227-08 138th Ave., Laurelton, each were arraigned in a Central Islip courtroom on first-degree robbery charges in connection with the robbery of the bank, 1701 Sunrise Hwy. in Bay Shore.

Police captured the pair after their 2015 Ford Escape collided with a Nassau County Highway Patrol vehicle in Woodbury.

“They waved their guns, pointed them at the tellers . . . demanded their money,” Assistant District Attorney Anne E. Oh said at the arraignment in First District Court. “They jumped over the counter.”

Highland was charged with unlawful fleeing a police officer after the chase that started in Wyandanch and lasted nearly 10 miles, authorities said. He also was issued more than a dozen tickets, including disobeying three stop signs and third-degree aggravated unlicensed operation, records show.

Highland also was arraigned on a Dec. 29 robbery of the Capital One branch at 8 Little East Neck Road in Babylon. In that robbery, a masked man made off with more than $3,200.

advertisement | advertise on newsday

Hawkins’ Legal Aid attorney denied the charges in court and pointed out that her client coaches his daughter’s summer league team and is a member of a church.

Oh said Hawkins confessed to Wednesday’s robbery but his attorney said none of the victims directly identified her client.

Highland’s attorney, Bryan Cameron of Sayville, entered a not-guilty plea.

District Court Judge Pierce Cohalan held Hawkins on $500,000 cash bail or $1 million bond. Highland was held without bail. Cameron said his client is being held for authorities from a parole violation in Nassau County. He declined further comment.

Prosecutors and court papers offered additional details into Wednesday’s robbery — which was caught on surveillance cameras shortly after 9 a.m. — and the fear tellers experienced.

Witnesses said the suspects wore black ski masks and pointed handguns at the tellers, yelling at everyone to put their hands up and not to move. There were three customers and three tellers in the bank, Oh said.

At one point, one robber took all of the money out of a teller’s cash box and a GPS device, the witness said. That same teller said they hit the panic alarm when they were sure the two men had left. The robbers made off with about $2,000, court papers said.

“I was shaking so much. I was so scared but I was in charge and I was holding it together,” the witness told police.

Another witness said: “I thought I was going to get shot,” according to court papers.

About 9:15 a.m., Suffolk police located the getaway SUV in Wyandanch and the pursuit began when officers tried to pull over the vehicle, police said. Highland drove more than 25 mph over the speed limit at points, court papers said. Highland led officers from Suffolk and Nassau counties and the New York State Police during the pursuit, which headed north on Bagatelle Road to the westbound Long Island Expressway.

advertisement | advertise on newsday

About 9:26 a.m., Nassau police said Suffolk police radioed for help with the pursuit on the LIE.

Highland headed north on Route 135, the Seaford-Oyster Bay Expressway, police said. Suffolk and Nassau police captured the two men Wednesday after, authorities said, they jumped from the SUV at the end of the Seaford-Oyster Bay Expressway at Jericho Turnpike in Woodbury, sparking a school lockdown.

Highland was transferred to a hospital, officials said, and a Nassau police officer sustained a minor knee injury in the crash. A Suffolk officer also sustained a minor knee injury in the pursuit, officials said.

Authorities said they don’t believe any shots were fired during the chase.

Oh said police later recovered from the SUV a .40-caliber handgun and a black semi-automatic gun used in the robbery.

advertisement | advertise on newsday

Hawkins has had 36 felony arrests that resulted in plea bargains for misdemeanor charges in Queens County, Oh told Cohalan. In 2010, Hawkins pleaded guilty to fifth-degree criminal possession of a controlled substance, a Class D felony, Oh said.

Highland has been convicted of first- and second-degree robbery and attempted murder, Oh said.