This reaction is used for transforming primary alkyl halide into primary amines.
Secondary and tertiary amines are not formed by this synthesis, so pure primary amines are formed which is the reason why this reaction is preferred for formation of primary amine.This is a 3 step reaction:
Step 1:
Phthalimide is treated with potassium hydroxide (KOH) initiating an acid-base reaction. Imide is deprotonated by the hydroxide ion. This forms a potassium salt of phthalimide (imide ion) which is nucleophilic in nature.

Step 2:
Now, the obtained imide ion is treated with alkyl halide (R−X). The electrophilic carbon of the alkyl halide is attacked by the nucleophilic imide. Halogen atom of the alkyl halide is removed and replaced by the nitrogen atom which bonds with the carbon itself. This results in the formation of N-Alkyl Phthalimide.

Step 3:
N-Alkyl Phthalimide then undergoes alkaline hydrolysis by reaction with aqueous Sodium Hydroxide (NaON(aq)). The hydroxide ion from Sodium hydroxide reacts with the carbon atom from the alkyl group causing the cleavage of N-Alkyl Phthalimide and the cation attaches itself to the oxygen atom. When the oxygen atom replaces the nitrogen in phthalimide the ejected hydrogen ions get attached to the nitrogen which was already attached to the alkyl (R) group.
Only aliphatic primary amines are formed and not aromatic because aryl halides do not undergo the nucleophilic substitution reaction with the anion formed by phthalimide.
