Photoluminescence at 1.54µm from Er in Si has received much attention because of the possible uses in optoelectronics. Incorporating Er in porous silicon (PSi) might lead to efficient luminescence at this wavelength. We have prepared porous silicon layers by anodic etching of p-type silicon single crystal wafers in an electrolyte consisting of hydrofluoric acid and ethanol. Thereafter Er has been incorporated into the PSi layers by immersing the PSi layers in a solution of ErCl3 in ethanol in an electrochemical cell with positive Pt electrodes and the Si wafer as the negative electrode. The distribution of Er and Cl in the porous layer has been examined using a scanning electron microscope with an energy dispersive X-ray spectroscopy system. After immersing the PSi layers in the ErCl3 solution it is observed that both Er and Cl are present in the porous silicon layer. These elements are also present in the PSi layer for samples prepared with no bias or current flowing in the electrochemical cell and the bias seems to have no significant effect on the amount or distribution of the elements. After annealing the samples at 800°C for 60min in a 20% O2/80% N2 atmosphere practically all the Cl has escaped from the PSi layer while much Er remains.