We show the feasibility of introducing a dispersion of a refractory ceramic phase into metals by stirring a powder of an organic polymer into a magnesium melt and having it convert into a ceramic within the melt by in-situ pyrolysis of the polymer. The pyrolysis is a highly reactive process, accompanied by the evolution of hydrogen, which disperses the ceramic phase into nanoscale constituents. In the present experiments, a polysilazane-based precursor, which is known to yield an amorphous ceramic constituted from silicon, carbon, and nitrogen, was used. Five weight percent of the precursor (which has a nominal ceramic yield of 75 to 85 wt pct) produced a twofold increase in the room-temperature yield strength and reduced the steady-state strain rate at 450 °C by one to two orders of magnitude, relative to pure magnesium. This polymer-based in-situ process (PIP) for processing metal-matrix composites (MMCs) is likely to have great generality, because many different kinds of organic precursors, for producing oxide, carbides, nitrides, and borides, are commercially available. Also, the process would permit the addition of large volume fractions of the ceramic, enabling the nanostructural design, and production of MMCs with a wide range of mechanical properties, meant especially for high-temperature applications. An important and noteworthy feature of the present process, which distinguishes it from other methods, is that all the constituents of the ceramic phase are built into the organic molecules of the precursor (e.g., polysilazanes contain silicon, carbon, and nitrogen); therefore, a reaction between the polymer and the host metal is not required to produce the dispersion of the refractory phase.