Provided herein is an improved, convenient, commercially viable and environmentally friendly process for the preparation of varenicline or a pharmaceutically acceptable salt thereof comprising reacting 1-(4,5-diamino-10-aza-tricyclo[6.3.1.02 7]dodeca-2(7),3,5-trien-10-yl)-2,2,2-trifluoro-ethanone with chloroacetaldehyde in the presence of an oxygen source. Provided further herein is an improved and industrially advantageous process for the preparation of 1-(4,5-diamino-10-aza-tricyclo[6.3.1.02 7]dodeca-2(7),3,5-trien-10-yl)-2,2,2-trifluoro-ethanone.