Time resolved high-resolution X-ray powder diffraction was utilized to obtain detailed changes in the crystal structure parameters during the hydrothermal crystallization process of the nanoporous aluminophosphate AlPO-5 (AFI) structure. This in situ study offered not only the influence of metal ions on the onset of crystallization and estimation of the activation energy of the process, but also allowed us to determine in detail the changes in lattice parameters during this process. More importantly the time-resolved study clearly showed the lattice expansion in the divalent metal ions substituted system right from the on-set of crystallization process, compared to the one without any dopant ions, which suggest that an amorphous or poorly crystalline network is formed prior to crystallization that contains the large divalent ions (compared to Al(iii), the substituting element), which is in agreement with the combined XAS/XRD study reported earlier. A mechanism based on this and the earlier study is suggested.