Complex sentence: Soon he found out that it was unsafe to stay in Baghdad, and as a result he immediately escaped back to Iran.
Split into simpler sentences: Soon he found out that it was insecure to stay in Baghdad. As a result he immediately escaped back to Iran.