Police are investigating an attempted robbery involving a handgun at a Riverhead gas station early Friday, police said.

Riverhead police received word about 12:30 a.m. that a male suspect displaying a black semiautomatic handgun and approached another man from behind while in the Mobile Gas parking lot on Route 58, police said.

The suspect demanded the victim to get into his own car, which the victim was unlocking, according to the report.

When the victim refused to comply, the suspect — described as a 35 to 40-year-old black male, about 5-foot-10-inches tall, wearing a black mask and a gray hooded sweatshirt — took off on foot, police said.

State police and Riverhead police officers searched the area with the help of a K-9 unit, but were unable to locate the suspect, police said.

The case was turned over to the detectives division, according to a report.