The visit came days after Pakistani Prime Minister Shahid Khaqan Abbasi traveled to the U.S. on an unannounced visit

Pakistan's Foreign Ministry says Pakistan and the United States have resolved to act against all militant groups that target Pakistan and neighboring Afghanistan.

In a statement Thursday, the ministry said the understanding was reached during a meeting between visiting U.S. acting Assistant Secretary of State Alice Wells and Pakistan's Foreign Secretary Tehmina Janjua.

The visit came days after Pakistani Prime Minister Shahid Khaqan Abbasi traveled to the U.S. on an unannounced visit, which was later termed a private one, and during which he met with U.S. officials in an effort to improve ties with Washington.

U.S. officials have long accused Pakistan of harboring militant groups that carry out attacks in Afghanistan.

Pakistan denies the charge, saying it targets militants without discrimination.