CNN  — 

Outgoing U.S. Secretary of Defense Chuck Hagel arrived in Baghdad on Tuesday for a previously unannounced visit.

The reason? To thank American troops for their role in fighting ISIS, said Rear Adm. John Kirby.

During his visit, he will meet with Iraqi leaders and receive operational updates from senior military officials.