Mannich prepares 3-aminocarbonyls from primary or secondary amines, methane, and an enolizable carbonyl. Let's see an example:

The Mannich mechanism takes place in the following steps:
Step 1 . Formation of the immonium cation

Step 2. Enolization of the carbonyl

Step 3. Condensation of the enol with the immonium cation

Step 4. Hydrochloride formation

Step 5. Neutralization of the acid medium
