Theodore Roosevelt became the first US president to visit another country while in office, visiting Puerto Rico and Panama.
Source