ISLAMABAD, Pakistan — Defense Secretary Jim Mattis, on his first visit to Pakistan in that role, called on its top military and civilian officials Monday to “redouble” efforts to prevent Islamist militants from using the country as a refuge and a launchpad for attacks on Afghanistan and elsewhere. But Mattis seemed to tone down the sharp language he has used in congressional hearings and other settings to accuse Pakistan of harboring Afghan Taliban fighters. Instead, he adopted a milder, more diplomatic approach aimed at finding “common ground.” Statements from the Pakistani prime minister’s office and the Pentagon late Monday, after Mattis had left the country, described his interactions with Prime Minister Shahid Khaqan Abbasi, the defense minister, and military and intelligence chiefs in positive, bland terms. The U.S. Embassy said he praised Pakistan’s “sacrifices in the war against terrorism” while insisting that it “must redouble its efforts to confront” militants within its borders. Abbasi was even more upbeat, saying in a statement that both countries share a commitment to the war against terrorism and asserting that there are “no safe havens” for militants in Pakistan. He emphasized Mattis’s comments about continuing the long-term relationship between the former Cold War allies and “deepening cooperation” for the common goal of “eliminating terrorism from the region.” [The U.S. says Pakistan must work with Afghanistan on terrorism. It won’t be easy.] There was no public mention from either side of the repeated threats by President Trump and other top U.S. officials that Washington will take strong action against Pakistan if it fails to stop sheltering militants. The punitive measures could include significant cuts in military and economic aid, retracting Pakistan’s status as a “major non-NATO ally,” and declaring it a state sponsor of terrorism. Pakistani army officials said they told Mattis that “Pakistan has done much more than its due share despite capacity constraints.” They said Mattis told them that his aim was “not to make demands.” In a statement, the officials said the U.S. defense chief expressed concern that “a few elements” use Pakistani