Senator John McCain (R-Arizona) made a secret trip to northern Syria last week to meet with U.S. troops and Kurdish fighters amid their longstanding battle to defeat ISIS, his office said Wednesday.

“Senator McCain traveled to northern Syria last week to visit U.S. forces deployed there and to discuss the counter-ISIL [another acronym for ISIS] campaign and ongoing operations to retake Raqqa,” a McCain spokesperson said in an emailed statement on Wednesday, referring to ISIS' Syrian capital. “Senator McCain’s visit was a valuable opportunity to assess dynamic conditions on the ground in Syria and Iraq.“

The trip comes as the Trump administration continues to re-evaluate the U.S. approach and plan to defeat ISIS. On the campaign trail, President Trump frequently criticized the Obama administration's policy to defeat the group that controls territory in both Syria and neighboring Iraq, but which has lost significant territory in the last two years.

McCain's office did not confirm the exact dates he was in Syria.

On Wednesday, the U.S.-led anti-ISIS coalition pushed further into Mosul, Iraq's second largest city, in an a bid to wrest control of it from ISIS, which captured the city in 2014. Meanwhile, the U.S. military and its allies have for months been preparing a campaign to retake Raqqa in Syria, where ISIS has its de facto capital.

Members of Congress rarely travel to Syria as it does not have diplomatic ties to the U.S.

McCain, who is chairman of the Senate Armed Services Committee, also traveled to the country in 2013 to meet with Syrian rebel leaders fighting the government of Syrian President Bashar al-Assad.

The senator has been a consistent proponent of increased military action in Syria, both against Assad's forces as well as ISIS. He was very critical of the Obama administration's decision not to launch airstrikes against Assad's forces after it came to light that the Syrian president had reportedly used chemical weapons against Syrian rebels.

But McCain has also emerged as a critic of aspects of Trump’s foreign policy. During a speech at the Munich Security Conference in Germany on Friday, McCain said the new administration was in a state of "disarray."

Still, McCain agreed with Trump’s order to review the country’s military “strategy and plans to defeat ISIL,” according to the statement provided Wednesday by his office. “Senator McCain looks forward to working with the administration and military leaders to optimize our approach for accomplishing ISIL’s lasting defeat."

ABC News' Ali Rogin contributed to this report.