The reaction of alkanoyl halides with alcohols produces esters. The equilibria of this reaction are favored by eliminating the hydrochloric acid with a base (tertiary amine, pyridine)
![reaction-halides-alkanoyl-alcohols reaccin-haluros-alcanoilo-alcoholes](/images/stories/organica-ii/haluros-alcanoilo/reaccion-alcoholes/reaccin-haluros-alcanoilo-alcoholes-01.png)
The mechanism occurs in two stages:
Stage 1. Addition of alcohol
![reaction-halides-alkanoyl-alcohols reaccin-haluros-alcanoilo-alcoholes](/images/stories/organica-ii/haluros-alcanoilo/reaccion-alcoholes/reaccin-haluros-alcanoilo-alcoholes-02.png)
Stage 2. HCl removal
![reaction-halides-alkanoyl-alcohols reaccin-haluros-alcanoilo-alcoholes](/images/stories/organica-ii/haluros-alcanoilo/reaccion-alcoholes/reaccin-haluros-alcanoilo-alcoholes-03.png)
Tertiary amines cannot form amides and give rise to alkanoyl ammonium salts, which is why they are suitable for removing the hydrochloric acid formed from the medium.