A histamine piezoelectric (acoustic) sensor using a molecularly imprinted polymer (MIP) film has been devised and tested. The sensor comprises an electrodeposited MIP film as the recognition element and a 10 MHz AT-cut shear-thickness-mode bulk-acoustic-wave quartz crystal resonator with Pt film electrodes as the signal transducer. Preparation of the sensing film involved two consecutive electrochemical polymerizations, performed under cyclic voltammetric conditions, with the use of a supporting electrolyte of 0.1 M tetra-n-butylammonium perchlorate in acetonitrile. First, a poly(bithiophene) barrier film was deposited by electropolymerization on the Pt/quartz resonator to prevent histamine electro-oxidation and avoid possible contamination of the Pt electrode surface. Next, the histamine-templated MIP film was deposited by electropolymerization on top of this barrier film. For that purpose, two functional monomers of bis(bithiophene) derivatives, i.e., one bearing the 18-crown-6 and the other dioxoborinane substituent, were copolymerized in the presence of the histamine template. The consecutive growth of both these overlaid films was monitored with an electrochemical quartz crystal microbalance (EQCM). Subsequently, the histamine was extracted from MIP with 0.01 M NaOH for 12 h. The UV-vis and X-ray photoelectron spectroscopic measurements confirmed the completeness of the removal of the histamine template from the MIP film. The analytical performance of the chemosensor was assessed under flow injection analysis (FIA) conditions using the carrier 0.5 M HEPES buffer (pH = 7.5) solution and the piezoelectric microgravimetry detection at QCM. The negative peaks of resonant frequency linearly decreased with the increase of the histamine concentration in the range 10-100 mM for 150 microL/min flow rate, and 100 microL volume of the injected sample. The sensitivity of the chemosensor (0.33 Hz/mM) was more than twice as that of the chemosensor without the poly(bithiophene) barrier film (0.15 Hz/mM). The chemosensor performance was superior for selective histamine recognition if the poly(bithiophene) barrier film thickness exceeded 200 nm. The chemosensor discriminated histamine from functionally or structurally similar compounds, such as dopamine, tryptamine, and imidazole. Stability constants of the affinity complexes of MIP and analyte or the interfering agent were determined from kinetic studies. For the MIP-histamine complex, the stability constant thus evaluated was equal to 57.0 M(-1) being much higher than those for the MIP-tryptamine and MIP-dopamine complexes determined to be 10.7, and 6.4 M(-1), respectively. The concentration limit of detection was as low as 5 nM histamine if the carrier solution flow rate was as low as 35 microL/min and the injection sample volume as large as 1 mL.