Narrative:

Student was performing a soft field takeoff at ZZZ. Upon leaving ground effect to begin the takeoff climb out (approximately 50-100' AGL); the engine became significantly rough; shaking and making a loud banging noise. I determined the aircraft not safe for flight and took over controls; reduced power to idle; informed ZZZ tower of the engine problem; and that I intended to make an immediate landing. I landed the plane on the remaining runway; and applied hard braking; bringing the aircraft to a safe speed prior to the end of the runway. Flight terminated.

Google
 

Original NASA ASRS Text

Title: C172 flight instructor reported an engine malfunction after takeoff; which resulted in an immediate landing on the remaining runway surface.

Narrative: Student was performing a soft field takeoff at ZZZ. Upon leaving ground effect to begin the takeoff climb out (approximately 50-100' AGL); the engine became significantly rough; shaking and making a loud banging noise. I determined the aircraft not safe for flight and took over controls; reduced power to idle; informed ZZZ tower of the engine problem; and that I intended to make an immediate landing. I landed the plane on the remaining runway; and applied hard braking; bringing the aircraft to a safe speed prior to the end of the runway. Flight terminated.

Data retrieved from NASA's ASRS site and automatically converted to unabbreviated mixed upper/lowercase text. This report is for informational purposes with no guarantee of accuracy. See NASA's ASRS site for official report.