Phosphorus (P) retention in soils in the presence of organic matter (OM) has been, for years, a topic with no clear conclusions. Considering the important ecological functions of peatlands, the objective of this study is to examine the role of OM transformation in relation to P status in Histosols in the Oder Valley (Poland). Basic physical and chemical properties and the following P forms were determined in the organic horizons of 5 soil profiles from two habitats (eutrophic and dystrophic): total (Pt) and organic P (Po), available P (PM3), easily soluble P (PCaCl2), water-soluble P (PW), and fraction of Po in humic (Po_HA) and fulvic (Po_FA) acids after extraction with 0.5 mol L−1 NaOH. The results were statistically verified in both examined habitat groups separately. The higher values of mobile P forms were found in the upper organic horizons released from OM constituents as a result of their decomposition. The role of OM in P retention was strongly related to the activity of humic substances (HS): a higher Po percentage (6.9–99.4% of Po) was observed in dystrophic, whereas a lower (9.3–28.6% of Po) was observed in eutrophic Histosols. Humic acids played a dominant role in P retention compared to fulvic acids in most peat horizons, especially at pH < 5. The role of HA and FA in P retention was clearly dependent on forms found only in eutrophic Histosols. The important role of FA in P retention during OM transformation was confirmed by negative correlations between Po_FA and macronutrient ratios in both soil groups. The results confirm the variable role of OM in P retention, depending on soil environmental conditions and OM type (peat and moorsh). This may have important applications not only in areas of natural importance, for which the release of mobile P forms may be a threat, but also in agricultural areas where, for a change, we struggle to increase P availability.