A man suspected of gunning down an imam and his friend as they left a New York City mosque was denied bail Tuesday afternoon during his first court appearance since being charged with murder.

Police have yet to release a motive behind the killings.

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

Prosecutors on Tuesday said the bullets used to kill Akonjee and Uddin came from a gun police recovered at Morel's Brooklyn home on Monday night.

Morel was taken into custody late Sunday night outside a Brooklyn apartment as he approached a vehicle that police had linked to an unrelated hit-and-run 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 Robert Boyce, the New York Police Department's chief of detectives. "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 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 the revolver and clothes similar to those worn by the gunman in the surveillance video.

According to The New York Post, Morel admitted to police that he was at the scene during the time of the murders and that he’s the person caught on video sneaking up behind the two men. But he said he didn’t shoot anyone.

“I did not shoot the guy,’’ Morel told police, The Post reported.

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 in the murders was still unclear. However, Boyce said the possibility that the murders were a hate crime is “certainly on the table.”

Alvin Morel, Oscar’s brother, insisted to The Post that the killings were not a hate crime. He said that his brother felt hatred toward Muslims on 9/11, but it was “only temporary” and that he “now has no hate for the Muslims.”

“We’re Catholic-school kids — we don’t do this,” Alvin added. “He’s a good guy.”

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.

The Associated Press contributed to this report.