During the chemical synthesis nanometer-sized particles of ferrous iron oxide were in situ infiltrated into the mesopores in a porous silicon film. The microstructures of porous silicon and the magnetic properties of the nanometer-sized particles of the ferrous iron oxide were characterized with scanning electron microscopy, X-ray diffractometry, and the hysteresis loop measurement, respectively. Our results have demonstrated that the magnetic properties of the nanometer-sized Fe3O4 particles can be dramatically modified when they are confined into the mesopores of the porous silicon film.