While driving the vehicle a burning smell became present. I pulled over into the nearest parking lot. Smoke started to come out of the engine compartment and increased over a short period of time. Fire flames came through the hood of the car. I called 911 and the fire department had to put out the flames. The car got towed and is sitting in a tow yard pending an insurance inspection. My safety was at risk because the car was engulfed in flames. Not sure if this problem has been reproduced, but I have seen reports of similar Nissan vehicles catching on fire in a similar manner. There were no warning signs that there was an issue with the car and I kept the maintenance of the car up to date. Dashcam installed in car captured me pulling over, the car begin to smoke and flames coming up from the hood.