Article 5 of the North Atlantic Treaty says each party, in response to an armed attack on one or more of them in Europe or North America, "will assist the Party or Parties so attacked" by taking "such action as it deems necessary," according to the treaty text, and NATO's Article 5 page says NATO has invoked it once, "for the first and only time in its history", after the attacks of September 11, 2001.
The commitment in the treaty's words
The treaty text reads in sequence: "The Parties agree that an armed attack against one or more of them in Europe or North America shall be considered an attack against them all". It continues that each party, "in exercise of the right of individual or collective self-defence recognised by Article 51 of the Charter of the United Nations, will assist the Party or Parties so attacked by taking forthwith, individually and in concert with the other Parties, such action as it deems necessary, including the use of armed force, to restore and maintain the security of the North Atlantic area."