A green and efficient method for the preparation of 5-aryl-4-hydroxy-2-methyl-1H-pyrrole-3-carboxylic acid esters and 6-aryl-3-methylpyridazine-4-carboxylic acid esters via three-component reaction of arylglyoxal hydrates with B-dicarbonyl compounds in the presence of ammonium acetate and hydrazine hydrate using water as solvent under ultrasonic irradiation was reported. The reactions proceeded rapidly and afforded the corresponding pyrroles and pyridazines in good to high yields in very short reaction time.