The present invention provides a simple process for the preparation of highly pure intermediate compound 5-formyl-2,4-dimethyl-lH-pyrrole-3-carboxylic acid (2-diethylaminoethyl) amide through acid-base treatment. The invention further provides use of 5-formyl-2,4-dimethyl-lH-pyrrole-3-carboxylic acid (2-diethylaminoethyl) amide for the preparation of “substantially pure sunitinib or pharmaceutically acceptable salts” thereof