In a method of synthesizing an aluminophosphate or metalloaluminophosphate molecular sieve, a synthesis mixture is provided comprising water, a source of aluminum, a source of phosphorus, optionally a source of a metal other than aluminum, a tertiary amine, and an alkylating agent capable of reacting with said tertiary amine to form a quaternary ammonium compound capable of directing the synthesis of said molecular sieve. The synthesis mixture is maintained under conditions sufficient to cause the alkylating agent to react with the tertiary amine to produce the quaternary ammonium compound and to induce crystallization of the molecular sieve.