This work reports the synthesis and the binding tests on the 5-HT3 and 5-HT4 receptors of new thienopyrimidopiperazine and piperazinylacylaminodimethylthiophene derivatives, in order to identify potent and selective ligands for each receptor. The 3-amino-2-(4-benzyl-1-piperazinyl)-5,6-dimethyl-thieno[2,3-d]pyrimidin-4(3H)-one derivative 28 showed the highest affinity and selectivity for the 5-HT3 over the 5-HT4 receptor (5-HT3 Ki=3.92 nM, 5-HT4 not active), whereas the 2-[4-[4-(2-pyrimidinyl)-1-piperazinyl]butanoylamino]-4,5-dimethyl-3-thiophenecarboxylic acid ethyl ester (41) showed the highest affinity and selectivity for the 5-HT4 over the 5-HT3 receptor (5-HT4 Ki=81.3 nM, 5-HT3 not active). Conformational analyses were carried out on the compounds of the piperazinylacylaminodimethylthiophene series (39-42) taking compound 41 as the template.