WASHINGTON — The United States transferred four detainees from the Guantánamo Bay prison to Afghanistanlate Friday, the Defense Department announced Saturday, fulfilling a request from the new Afghan president, Ashraf Ghani, in what officials here characterized as a show of good will between the United States and the government in Kabul.

The four men are not likely to be subjected to further detainment in Afghanistan, an Obama administration official said. The transfer brings the number of Afghans still held at the American military prison in Cuba to eight of the 132 detainees over all.

The transfer is the latest in a series of detainee releases and reflects a quickened pace, as President Obama has been pushing to make good on his goal of shutting the military prison at Guantánamo, a pledge that dates to the earliest days of his presidency. One administration official said more transfers are expected in the coming weeks.

Delays by Secretary of Defense Chuck Hagel in signing off on transfers that had been approved by Mr. Obama’s national security staff contributed to tensions between the exiting Pentagon chief and the White House, particularly with the national security adviser, Susan Rice. But Mr. Hagel, who resigned under pressure last month, has maintained all year that he would not be rushed into releasing prisoners.

In May, Ms. Rice sent Mr. Hagel a memo pressuring him to pick up the pace, and Mr. Hagel told reporters during a flight to Alaska at the time that he was in no hurry to approve deals. “My name is going on that document; that’s a big responsibility,” Mr. Hagel said. He added: “What I’m doing is, I’m taking my time. I owe that to the American people, to ensure that any decision I make is, in my mind, responsible.”

Some military officers have expressed worry that prisoners released from Guantánamo may return to the battlefield and harm American troops who remain in Afghanistan.