NEW YORK - (AP) -- A man suspected of gunning down an imam and his friend as they left a New York City mosque was arrested and charged with murder late Monday night, said police, who have not yet released a motive for the shooting deaths.

Police charged Oscar Morel, 35, with two counts of second-degree murder and two counts of criminal possession of a weapon in the Saturday afternoon slayings of Imam Maulana Alauddin Akonjee and Thara Uddin near the Al-Furqan Jame Masjid mosque in the Ozone Park neighborhood of Queens.

Officers took Morel into custody late Sunday night outside a Brooklyn apartment as he approached a vehicle that police had linked to an unrelated hit-and-run and that matched the description of the shooting suspect's getaway vehicle.

"Detectives from the Fugitive Task Force Unit approached the car, and then he rammed the detectives' car several times in an effort to get away," said the New York Police Department's chief of detectives, Robert Boyce. "He was placed under arrest without any further incident and brought back to the precinct for more debriefing."

Boyce said Morel was seen on surveillance video fleeing the area of the shooting in a black GMC Trailblazer. About 10 minutes later, a car matching that description struck a bicyclist nearby in Brooklyn.

Morel initially was charged in connection with the hit-and-run, but those charges were upgraded Monday night after police said they recovered a revolver at his Brooklyn home and clothes similar to those worn by the gunman in the surveillance video.

Earlier Monday, about 1,000 people gathered at an Islamic funeral service for Akonjee, 55, and Uddin, 64, where emotions ran high.

The ceremony featured several speakers who said they believed the victims were targeted because of their religion. Some members of the congregation shouted, "Justice!" periodically throughout the service.

After the ceremony, part of the crowd marched to the spot a few blocks away where the shooting took place.

Mayor Bill de Blasio, a Democrat, told those gathered that the entire city was "mourning with you."

A motive for the killings remains unclear, though Boyce said the possibility that the murders were a hate crime is "certainly on the table."

Some in the largely Bangladeshi Muslim community in Queens and Brooklyn have described harassment in recent months by people who shouted anti-Muslim epithets.

Boyce said Morel may have worked in a warehouse in the East New York neighborhood of Brooklyn, but he wouldn't comment any further on his background or mental state. It was not immediately clear if Morel had an attorney who could comment on the charges.