On my way home from purchasing the vehicle, the car began to lose power and i noticed black smoke though the rear view mirror. Another driver signaled me down, so I pulled over and realized my car was on fire. The fire was in the engine compartment from what appeared to be the exhaust manifold. Since i was in a residential area, i grabbed a water hose and began to diffuse the fire. The fire department arrived and forced my hood open to reassure the fire was out. Luckily i was able to make it out safe. But i strongly believe my life and the lives of other drivers were definitely in danger