The cell wall is a tough and rigid layer that surrounds some types of cells. It is located outside the cell membrane and its main function is to provide rigidity, strength, protection against mechanical stress and infection. It can also provide the cell with limited plasticity that will prevent the cell from rupturing due to turgor pressure.