Was driving on highway at approximately 65 mph. Check engine light came on. Engine started to stop responding to gas being given to car. Pulled off to exit highway approximately 1 minute after check engine light came on. At bottom of exit, car completely lost power. Attempted to put vehicle into park and wouldn't shift. Started to see smoke coming from engine and then shortly after started to see flames coming from engine. Immediately exited vehicle and called 911. No one was injured. Subaru indicated fire started as result of external influences. Insurance company's 3rd party auditors were not able to determine cause of fire.