Secretary of State Rex Tillerson made back-to-back, unannounced visits to Afghanistan and Iraq on Monday, flying into both countries under great secrecy out of concern that he might be a target for militants.

As his day looked likely to stretch from before dawn to past midnight, covering almost 4,000 miles, Tillerson and his aides donned flak vests and helmets in Baghdad before boarding helicopters that took them to the U.S. Embassy and elsewhere in the Green Zone to meet with Iraqi Prime Minister Haider al-Abadi and President Fouad Massoum.

Tillerson’s visit to Afghanistan was conducted in even greater secrecy and was announced only after he had left the country. Though he never left Bagram air base, north of Kabul, his short visit showcased U.S. support for the Afghan government after a week of Taliban attacks that killed more than 200 people.

After arriving from Doha, Qatar, on his swing through the Middle East and South Asia, Tillerson met with President Ashraf Ghani to reaffirm the U.S. commitment to helping Afghanistan win its war with the Taliban and achieve peace, according to U.S. and Afghan officials.

“I thought it was very important to stop here in Afghanistan, coming to the South Asia region as part of the recently announced policy and strategy that President Trump put forth,” Tillerson said after meeting with Ghani for about an hour. He was referring to a U.S. buildup in Afghanistan that will add about 4,000 troops, for a total of 13,500 in the country.

The visit underscores the strong tone that Tillerson is expected to adopt with Pakistan during his visit with interim prime minister Shahid Khaqan Abbasi and other officials on Tuesday.

Earlier this year, Trump threatened Pakistan with sanctions for offering “safe havens” to terrorists near the border with Afghanistan — an allegation that Pakistani officials deny. On Monday, Pakistani media quoted senior officials in Islamabad as pledging to “work as closely as possible” to defeat terrorist groups on the border but insisting that the U.S. military “stay away from Pakistan.”

At Bagram air base, Tillerson reiterated the importance of Pakistan’s role in reaching peace with the Taliban.

“It is imperative in the end that we are denying safe haven to any terrorist organizations or any extremists to any part of this world,” he said. “This is very much a regional effort. . . . It was rolled out in the strategy itself, demanding that others deny safe haven to terrorists anywhere in the region. We are working closely with Pakistan, as well.”

Tillerson said he will discuss with Pakistani leaders “specific requests” by the Trump administration for actions that cripple the support networks of the Taliban and other extremist groups.

Tillerson also said future U.S. aid to Pakistan will be “conditions-based.”

"It will be based upon whether they take action that we feel is necessary to move the process forward for both creating opportunity for reconciliation and peace in Afghanistan but also ensuring a stable future Pakistan," he said.

Pakistani officials, who last week won some U.S. favor by rescuing an American woman, her Canadian husband and their children held hostage by a Taliban affiliate for five years, did not respond to messages seeking comment Monday.

Tillerson’s trip to Afghanistan was cloaked in extraordinary secrecy, even by the standards of previous visits by U.S. secretaries of state. His public schedule listed a morning meeting at the U.S. Embassy in Qatar that was later “canceled.”

He flew from Doha to Bagram accompanied by a small contingent of pool reporters who are traveling with him. A total news blackout was imposed until after they left the country and returned to Qatar.

He arrived about 11:30 a.m. at Bagram air base, where he was met by Gen. John Nicholson, commander of the U.S.-led NATO effort in Afghanistan, and U.S. Ambassador Hugo Llorens.

Tillerson then met with Ghani, Abdullah Abdullah, the nation’s chief executive, and other top Afghan officials at the airfield, where they discussed the importance of weeding out corruption and ensuring that the 2018 parliamentary elections go forward as scheduled to strengthen the country’s stability.

In a statement, Ghani vowed to follow through.

"The Afghan people are supportive of the strategy and hope that it will ensure peace and security," he said.

After the meeting, Tillerson called on moderate members of the Taliban to join the effort for peace, saying they could be part of the government if they renounce terrorism.

“There are, we believe, moderate voices among the Taliban, voices that do not want to continue to fight forever,” he said. “They don’t want their children to fight forever. So we are looking to engage with those voices and have them engage in a reconciliation process leading to a peace process and their full involvement and participation in the government.”

Taliban fighters sought to demonstrate strength last week in the face of the mounting U.S. buildup, carrying out suicide attacks that killed dozens of Afghan police officers and troops, along with dozens of civilians.

Earlier Monday, the Taliban was dealt a blow when Afghan intelligence agents arrested one of its top leaders, Soor Gul, who is suspected of having orchestrated the suicide bombings.

Zabiullah Mujahid, a Taliban spokesman, was defiant at Tillerson’s suggestion that some fighters may be willing to lay down their arms.

“If America genuinely wants a peaceful settlement of the crisis, then it needs to pull out its troops and end the occupation,” he said.

Tillerson said the United States is “concerned and a bit saddened” by the dispute between the Kurdish regional government and the Iraqi central government, and encouraged the two sides to talk out their differences.

“I think if both parties commit themselves to a unified Iraq, to the Iraqi constitution, I think all differences can be addressed and the rights of all can be respected and Iraq will have a very secure and a prosperous future,” he said.

Morello reported from Qatar. Tamer El-Ghobashy in Baghdad, Pamela Constable in Islamabad and Sayed Salahuddin in Kabul contributed to this report.

Read more: