Sixteen cops connected to an NYPD ticket-fixing scandal pleaded not guilty today after the probe that uncovered the massive scandal began when a Bronx police officer was accused of having ties a drug dealer.

The cops stood before a judge in Bronx Supreme Court as hundreds of fellow officers turned up to the Bronx courthouse in a show of support.

The officers, both in plainclothes and in uniform, lined up inside and outside the courthouse in support of their fellow officers.

Prosecutors said the tickets would either be physically removed from the precinct station house after they’d been written or doctored them so that they would be dismissed.

In some cases, the cops who fixed tickets called cops who’d written the summonses and told to lie under oath so that the cases would be dismissed, prosecutors said.

Across the five boroughs, anywhere from $1 to $2 million in revenue could have been lost because of fixed tickets, authorities said.

“This is felony conduct. This is criminal conduct,” said Bronx DA Robert Johnson.

16 COPS IN TIX-FIX SCANDAL TURN THEMSELVES IN

READ RAMOS INDICTMENT (PDF)

At the same news conference this afternoon in the Bronx, Police Commissioner Ray Kelly said “these misdeeds tarnish the good name of police officers.”

He added that reforms have been put in place — like an electronic summonses tracking system — over the past year to make sure cops don’t exploit any loopholes.

Kelly said, “Those who try to rationalize [these crimes] are kidding themselves. … That trust must not be violated.”

Before the arraignments, police union officials lashed out at the NYPD for initiating the probe.

“Right now, this has been laid on the shoulders of police officers,” said PBA President Pat Lynch. “When the dust settles, and we have our day in court, it will be clear that this is part of the NYPD at all levels.”

The officers allegedly involved in the scandal turned themselves in Thursday night and earlier today.

As cops began showing up at Bronx Supreme Court in support of the officers accused of wrongdoing — some as early as midnight — police union officials began to organize outside the courthouse.

“We want to show as much support as we can and we line the wall,” said Joe Alejandro, a police union treasurer.

Jose Ramos, a cop investigated since 2009 for possible ties to a drug dealer, was the first to appear before a judge this morning, pleading not guilty.

Ramos, who was arrested last night coming out of a parent-teacher conference, was caught on wiretaps allegedly discussing ticket-fixing.

Cops had received a tip about Ramos and was being investigated for ties to a drug dealer at the time.

The charges against Ramos include attempted robbery, attempted grand larceny, attempted heroin possession and charges related to selling bootleg videos out of a Bronx barbershop he owns.

Kelly said an undercover cop, working as a barber, infiltrated the store and witnessed the illegal activities that took place there.

“These were serious offenses. … They followed the wrongdoing wherever it went,” said Kelly.

At the arraignment, Assistant Bronx DA Omer Wiczyk said of Ramos that he “sold his shield. He violated his oath.”

Outside the courthouse, Ramos’ lawyer John Sandleitner said, “They put him in the middle of this circus because that’s what it is.”

Of his alleged ties to Bronx drug dealer Lee King, Sandleitner said the dealer had “borrowed Ramos’ car and [was] got caught with marijuana. It’s guilt by association.”

He said the charges against his client don’t warrant his $500,000 bail. Ramos remains in custody because he can’t make bail, Sandleitner said.

After Ramos was arraigned, Lt. Jennara Everleth-Cobb, who works with the NYPD’s Internal Affairs Bureau, pleaded not guilty to charges she tipped off fellow cops to the probe. She was charged with three misdemeanors for leaking information about the probe and released with no bail.

Also arraigned was Sgt. Jacob Solorzano, who was charged with two counts of official misconduct. He was also freed without bail. Ramos was Solorzano’s NYPD driver and the sergeant was apparently with Ramos when the cop went to collect $30,000 in drug money from an uptown hotel.

Outside court, Solorzano’s lawyer John Patten said his client didn’t know Ramos planned to “rob someone” of $30,000 — but went along for a ride, noting, “he told him they were just messing with someone.”

“I don’t know why he was even indicted,” Patten said, adding that prosecutors noted that Solorzano was not aware of any criminal activity.

Three other officers, Christopher Scott, Ruben Peralta and Mark Manera, were charged with falsifying business records after they tried to allegedly cover-up an assault for a friend. They were released after pleading not guilty.

The cops were indicted on Sept. 23, and had been nervously cooling their heels since, waiting for the DA to take action.

Lawyers for the officers were notified starting at around 2:30 p.m. yesterday of the impending arrests, prompting them to hastily arrange for their clients’ surrender.

On his radio show this morning, Mayor Bloomberg said the cops involved represent “a tiny percentage of the people [in the NYPD].”

Kelly added that IAB is in place so that police misconduct can be exposed.

“It is a painful process, but a necessary one,” he said.