A pair of Queens residents have been arrested for allegedly hacking the electronic taxi dispatch system at John F. Kennedy International Airport and charging drivers to cut the line, federal prosecutors said Tuesday.

Daniel Abayev, 48, and Peter Leyman, 48, worked with Russian hackers to illegally access the computer system that ensures taxis are dispatched in order of arrival at JFK, the U.S. District Attorney's office in Manhattan alleged in a press release.

The two men charged cab drivers — who are required to wait in a holding lot at JFK before being dispatched to pick up a fare — $10 to move to the front of the line, according to prosecutors.

Waiting in the line can take hours, prosecutors said, and the wait time at the airport impacts how many rides a driver can complete in a day.

"As alleged in the indictment, these two defendants — with the help of Russian hackers — took the Port Authority for a ride," U.S. Attorney Damian Williams said in a statement. "For years, the defendants' hacking kept honest cab drivers from being able to pick up fares at JFK in the order in which they arrived."

To access the dispatch system, Abayev and Leyman bribed someone to insert a malware-ridden flash drive into the dispatch system's computer network, hacked the system's Wi-Fi connection and stole tablets connected to the system, prosecutors said.

The hack allowed them to fraudulently expedite up to 1,000 rides a day, according to prosecutors. When the two men had access to the dispatch system for the day, they would text "shop open" to various group chats.

Drivers learned about the hacking scheme — which lasted from November 2019 to November 2020 — by word of mouth, and some cabbies who recruited others into the scheme did not have to pay the $10 fee, the U.S. Attorney's office said.

Both men have been charged with two counts of conspiracy to commit computer intrusion, prosecutors said. They each face up to 10 years in prison if they are convicted.

Their attorney information wasn't immediately available Tuesday afternoon.