Islamabad, Pakistan (CNN) -- U.S. Vice President Joe Biden arrived in Islamabad on Wednesday to discuss anti-terrorism measures with top leaders and senior military officials.

During his trip, the vice president met with Pakistani President Asif Ali Zardari and Prime Minister Yousuf Raza Gilani.

The leaders will focus on their efforts in combating terrorism and how the two countries can work toward peace and stability in the region, a White House official said.

Biden arrived from an unannounced trip to Afghanistan, where he assured President Hamid Karzai that the United States would remain in Afghanistan beyond the 2014 handover deadline if the Afghans wants it to stay.

"Hopefully, we will have totally turned over the ability ... to the Afghan security forces to maintain the security of the country," Biden said. "But we are not leaving, if you don't want us to leave."

U.S. President Barack Obama has announced plans to begin withdrawing some troops from Afghanistan in July, with all combat troops scheduled to be out by 2014. There are 97,000 U.S. troops in Afghanistan.

Senior U.S. officials later explained that Biden was talking about the "enduring partnership" that Obama has spoken of, promising to maintain ongoing cooperation with the Afghan military beyond 2014 -- not only on civilian issues such as governance and economic development, but also on security, including training of the Afghan army and policy, and counterterrorism training.