After Islamist militants stormed a luxury hotel in Mali’s capital and took hostages on Friday, Malian Special Forces were called upon to respond. And in the middle of it all were two members of U.S. Special Operations Command, who escorted guests from the hotel to safer locations.

The rescue mission came after gunmen stormed the Radisson Blu Hotel in Bamako, a city of about 1.8 million people in the southwestern part of the country. It is within a few hundred miles of several other U.S. military partners in western Africa, including Senegal, Liberia and Guinea.

About 25 U.S. military personnel were in Bamako when the hotel was attacked, according to two U.S. military officials who spoke on condition of anonymity. At least six U.S. citizens were rescued from the scene, according to a tweet from U.S. Africa Command. At least 20 people were killed, including an American.

[Gunmen storm luxury hotel in Mali’s capital, taking hostages]

“We do have some people who are assisting in the hostage recovery efforts at the hotel,” said Chuck Prichard, a spokesman for Africa Command. “They helped move some of the civilians to secure locations as the Malian forces worked to remove the hostile forces from the hotel.”

A second spokesman for Africa Command stressed that they played only a small role in the rescue operation.

“It’s very important to understand they are not inside the hotel,” said Navy Lt. Cmdr. Anthony Falvo said. “They’re not kicking down doors or going after bad guys.” The two soldiers were visiting Bamako on temporary assignment, among a total of 25 U.S. military personnel inside the country. “They happened to be at the right place at the right time,” Falvo added.

There were about 170 guests in staff in the hotel when the militants stormed it. They killed at least three people, and took about 135 people hostage, hotel operators told The Washington Post. Malian security forces conducted room-by-room searches amid occasional gunfire, local media reports said.

The rescue effort puts a spotlight on a mission the governments in Washington and Bamako have quietly cultivated in recent years. French and U.S. troops have worked with the Malian military as it faces a continuing threat from militants, who seized portions of Mali’s north in 2012.

The burst of Islamist activity following an uprising against the Malian government in March 2012. It was led by Capt. Amadou Haya Sanogo, who had received training from the U.S. military in the United States.

[From 2013: Pentagon deploys small number of troops to Mali]

The United States was required by law to suspend military aid to Mali after the uprising, but the Pentagon has continued to send a handful of troops there at a time. U.S. military commanders are allowed to do so if they tailor the deployments to helping the French military and other African units in Mali, military officials have said. Some are assigned to the United Nations Multidimensional Integrated Stabilization Mission in Mali formed in 2013, according to a news release.

After the 2012 uprising, Tuareg separatists in Mali aligned themselves with Islamists, including members of al-Qaeda in the Islamic Maghreb (AQIM), following decades of neglect by the government. They overran the north, but Islamists then seized power from the more moderate Tuareg rebels and began enforcing strict Muslim law with beatings, stonings and other forms of violence.

The French military played a leading role in the response the following year with U.S. air support. Up to 4,000 French soldiers were involved, along with 6,400 soldiers from African nations, according to a Rand Corp. study of the mission. Among the French units involved were the French Foreign Legion, which included at least one U.S. soldier who had deserted to join.

Kevin Sieff, Brian Murphy and Sarah Kaplan contributed to this report.

Malian security force personnel escort people fleeing from the Radisson Blu Hotel in Bamako, Mali, on Friday, Nov. 20. (AP Photo/Harouna Traore)