While driving the vehicle I smelled something burning and saw smoke coming out of the air vents. I immediately pulled to the side of the road and got out. I noticed fire and smoke coming from under the hood. I called 911 and the Fire Dept. arrived to put the fire out. It was towed to a nearby storage yard until the insurance company could be notified. After talking with and submitting photos to the insurance company the vehicle was considered a total loss. We are waiting to hear back from the insurance company concerning our claim. Upon researching engine fire related to defective battery in these vehicles I learned that almost 2 million 2013-2018 Toyota RAV4 have been affected. I am just thankful everyone was able to get out of the vehicle safely before it caught on fire.