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.