The C-130 military cargo plane had taken off from Azerbaijan and was on its way back to Turkey when it crashed.