Phosphorus ($^{31}$P), which is essential for life, is thought to be synthesized in massive stars and dispersed into interstellar space when these stars explode as supernovae (SNe). Here we report on near-infrared spectroscopic observations of the young SN remnant Cassiopeia A, which show that the abundance ratio of phosphorus to the major nucleosynthetic product iron ($^{56}$Fe) in SN material is up to 100 times the average ratio of the Milky Way, confirming that phosphorus is produced in SNe. The observed range is compatible with predictions from SN nucleosynthetic models but not with the scenario in which the chemical elements in the inner SN layers are completely mixed by hydrodynamic instabilities during the explosion.