The United States and Britain warned their citizens on Monday to avoid hotels in Afghanistan, days after dozens were killed at a mosque in an attack claimed by the Islamic State group. The Taliban, which seized power in August and declared an Islamic emirate, are seeking international recognition and assistance to avoid a humanitarian disaster and ease Afghanistan’s economic crisis. But, as the hardline Islamist group transitions from a rebel army to governing power, they are struggling to contain the threat from the Afghanistan chapter of IS. “US citizens who are at or near the Serena Hotel should leave immediately,” the US State Department said, citing “security threats” in the area. “In light of the increased risks you are advised not to stay in hotels, particularly in Kabul (such as the Serena Hotel),” Britain’s Foreign, Commonwealth, and Development Office added. Since the Taliban takeover, many foreigners have left Afghanistan, but some journalists and aid workers remain in the capital. The well-known Serena, a luxury hotel popular with business travelers and foreign guests, has twice been the target of attacks by the Taliban. In 2014, just weeks before the presidential election, four teenage gunmen with pistols hidden in their socks managed to penetrate several layers of security, killing nine people, including a journalist and members of his family. In 2008, a suicide bombing left six dead.