Beechcraft Twin Piston Undifferentiated or Other Model
Flight Crew Commercial; Flight Crew Multiengine
Aircraft Equipment Problem Critical
Flight Crew Landed As Precaution; Flight Crew Returned To Departure Airport; Flight Crew Inflight Shutdown; General Maintenance Action
Aircraft
Aircraft appeared to be operating normally through start up and taxi.  Completed before take off checklist including all run ups with all checks appearing normal.  I entered [the] runway and rolled engines into full power.  All engine gauges were showing operations in the green.  I began rotating the aircraft at approximately 86 kts indicated.  Approximately 25 feet in the air; I brought the gear up and the right engine made a 'bang' sound then the aircraft yawed slightly to the right.  The takeoff was continued as the aircraft was past the point of a safe stop on the runway.  After a moment the yaw ceased and the engine sounded correct; a scan of the gauges showed everything still in the green.  Climbing at 120 kts the right engine made another bang sound followed by yawing to the right again.  The right engine continued the bang sound every few seconds with the plane yawing right each time.  I made the decision to return to the field and began configuring the plane to land.  I had the mixtures and props full forward.  I check the fuel valves and they were in the open detent position.  I decided to engage the electric fuel pumps in an effort to help the right engine.  Approximately 1/2 mile from Runway XX the right engine came to an abrupt stop.  I did not feather the prop as I was close to the ground and concentrating on getting the aircraft safely on the ground.  I exited [the] runway without further incident and taxied to the hangar and contacted Maintenance.
Pilot of a Beechcraft twin reported returning to departure airport after experiencing failure of the right engine.