President Trump also announced the truce, saying it had been mediated by the United States, although only Pakistan quickly acknowledged an American role.