The synthesis of 2,4,5-trisubstituted imidazoles with a Weinreb amide, ester, keto or aldehyde group, as well as 2,5-diaryl substituted imidazoles by the reaction of amidines with azirines has been reported. The reaction mechanism explaining dependence of imidazole structure on substituent at the position 2 of the azirine is discussed based on experiment with 15N-labelled azirine and DFT calculations.