The Pentagon's website today said he told U.S. Marines and soldiers that the enemy must be defeated, and that the "war on terror" could last half a century.
U.S. President George W. Bush announced Rumsfeld's resignation in early November, one day after his Republican Party fared poorly in midterm elections.
Rumsfeld, whose tenures under the Ford and Bush administrations (1975-77 and 2001-06) made him the youngest and then the oldest man to serve as defense secretary in U.S. history, had become a lightning rod for criticism of the U.S. war in Iraq.
Rumsfeld's visit is his 13th unannounced trip to Iraq since the U.S.-led war with that country began in early 2003.
A 26-year veteran of the CIA and former director of Central Intelligence, Robert Gates, is expected to be sworn in to replace Rumsfeld on December 18.
Rumsfeld Makes Farewell Visit To Iraq