A pharmaceutical long acting depot composition is provided as an aid to smoking cessation treatment. The formulation comprises a therapeutically effective amount of varenicline or its pharmaceutically acceptable derivative and pharmaceutically acceptable excipients. The process of preparation of the formulation is also provided.