The suspected gunman in Thursday's attack that killed four U.S. marines and a navy officer returned from a trip to Jordan in 2014 angry about conflicts in the Middle East and the reluctance of regional governments and the United States to intervene, a close friend of his told Reuters on Saturday.

Hours before the attack, the suspect, Mohammod Yousseff Abdulazeez, sent a text message to the friend, seen by Reuters, which links to a Quranic verse that includes the text: "Whosoever shows enmity to a friend of Mine, then I have declared war against him."

(Writing by Richard Valdmanis; Editing by Pravin Char)