Nabavi also served as deputy prime minister in the early 1980s when he negotiated with U.S. officials the release of American hostages held in the 1979 takeover by militant students of the U.S. embassy in Tehran .