A cement plug can be used to shut off a downhole flow. However, this generally involves abandonment of the well and loss of most of the drilling tools. It is also likely that the string will become plugged after pumping the cement, precluding any second attempt if the first should not succeed. Therefore, cement plugging should be regarded as the final option.
Cement plugs are set by pumping a quantity of quick setting (accelerated) cement into the annulus via the drillstring. The cement is usually displaced until the pump and choke pressures indicate that a bridge has formed. Quick setting cement reduces the possibility of gas cutting.
If a cement plug has to be set off bottom with mud below it, then consideration should be given to spotting a slug of viscous mud below the zone to be plugged. This precaution should be considered in long or deviated holes or when the cement slurry is substantially heavier than the mud.