The consent that a visibly nervous and agitated motorist gave police to search the trunk of his car during a traffic stop was voluntary and legally valid, a divided state appeals court ruled.

The Appellate Division, First Department, panel allowed to stand as evidence the 120 glassine envelopes containing heroin that police say they found in Jeffrey Mercado’s car. The discovery led to a 3 1/2-year prison sentence for Mercado on a conviction of third-degree criminal possession of a controlled substance.

While the dissenter in the 4-1 ruling said Mercado’s distraught demeanor weighed against a finding that his consent was truly voluntary, the majority held that Mercado’s agitation was properly considered by police as among the factors to justify asking him to open his trunk in the absence of a search warrant.

“No one circumstance” determines whether consent is voluntarily given to police for a search, the majority of the court said in an unsigned Aug. 28 ruling in People v. Mercado, 12684 4391/12.

“The officers did not handcuff the defendant or his traveling companion, nor did they threaten defendant with arrest or actually arrest him before obtaining his consent,” the court said. “Defendant admitted to having prior contact with the criminal justice system. Although defendant appeared to be very nervous, he was cooperative, alert and offered no resistance to any of the actions being taken by the police before he gave his consents.”

The court concluded, “The People satisfied their heavy burden of proving the voluntariness of defendant’s consent.”

The car Mercado was driving was stopped by two officers in an unmarked vehicle in Manhattan in October 2010. The officers said the car had caught their attention while illegally parked near a fire hydrant.

As they watched, they said Mercado briefly left the car when it was approached by another man. The two men had brief contact in which they “shook hands and either hugged or chest bumped each other,” the ruling said—an interaction that the officers took as a potential drug buy.

Later following the vehicle, police testified that they saw Mercado’s passenger lean forward in a way that suggested he was placing something beneath the front seat.

After seeing the Mercado car commit a second traffic violation, police stopped the vehicle. According to the ruling, Mercado was “sweating profusely” and crying. He told officers that he didn’t have a license and didn’t want to go back to jail. One of the police officers responded that he “wasn’t necessarily going back to jail.”

The car was found to be registered to another person.

The officers asked Mercado whether they could search the car, and he consented. Finding nothing illegal, the police then asked Mercado if they could search the trunk. He agreed. According to the decision, Mercado acknowledged that the heroin they found inside was his.

The majority of the appeals court found that given the totality of the circumstances involving the traffic stop, officers had the necessary “founded suspicion that criminality was afoot” to justify the searches.

“While nervousness, by itself, does not establish a founded suspicion of criminality, here it was coupled with other relevant factors,” the court said.

It cited the handshake or “chest bump” between Mercado and the man that officers saw before the traffic stop, the fact Mercado was driving with a suspended license, his inability to provide any form of identification and his statement that he did not want to return to jail as among those “relevant factors.”

“The request for defendant’s consent to search the trunk of the car was reasonably related in scope to the circumstances that justified the interference in the first place,” the court said, citing People v. William II, 98 NY2d 93 (2002). “Thus, the same founded suspicion that permitted the police to ask for consent to search the car extended to the request to search the trunk.”

Justices David Friedman (See Profile), David Saxe (See Profile), Paul Feinman (See Profile) and Judith Gische (See Profile) were in the majority.

The dissenter, Justice Rolando Acosta (See Profile), said he would have granted Mercado’s motion to suppress the drug evidence and vacated his guilty plea and sentence. Acosta wrote that Mercado’s nervousness was “simply insufficient indicium that criminal activity was afoot,” citing People v. Garcia, 85 AD3d 28 (1st Dept 2011).

The “most plausible” explanation that officers had for Mercado’s agitation and his statement about not wanting to go back to jail was that he was driving without a valid license, not that there was heroin in the trunk, Acosta said.

The judge added that he believed the majority’s ruling ignored the inherent coercion involved in a police request to search a vehicle.

“Here, defendant, already facing a possible arrest for driving without a license and distraught and crying about the possibility of going back to jail, may have felt compelled to consent to a search of the trunk,” Acosta wrote. “Under these circumstances, telling defendant that he ‘wasn’t necessarily going back to jail,’ could be easily construed ‘as long as you cooperate and let us search the trunk.’”

Mercado’s appellate attorney, Robert Dean of the Center for Appellate Litigation, said he would seek to appeal the ruling to the Court of Appeals.

“What the First Department is saying is that if you have a traffic stop—and police can make stops for virtually anything under the VTL [Vehicle and Traffic Law]—plus you have nervousness by the motorist, then the officer can ask to search your trunk,” Dean said in an interview Friday. “I’d say that is a very significant ruling.”

Assistant Manhattan District Attorney Allen Vickey represented the prosecution.

Manhattan Supreme Court Justice Bruce Allen denied Mercado’s motion to suppress the evidence found in trunk search. Justice Thomas Farber later accepted Mercado’s guilty plea and sentenced him in April 2013.

Mercado, 39, is scheduled for release in February 2016.