Shawali Khan, Khi Ali Gul, Abdul Ghani and Mohammed Zahir were repatriated after a review of their cases.
Eight Afghans are believed to be among the 132 detainees remaining at the US prison in Cuba.
President Barack Obama has pledged to close the facility, opened in 2002 to hold "enemy combatants" in what the US termed its war on terror.
"As a result of that review, which examined a number of factors, including security issues, these men were unanimously approved for transfer by the six departments and agencies comprising the task force," a Pentagon statement said on Saturday.
The four Afghans - who had been held at Guantanamo Bay for more than 10 years - were flown to Afghanistan's capital Kabul aboard a US military plane and handed over to the local authorities.
The Pentagon provided no further details.
Afghanistan's High Peace Council - a body set up by the government to deal with insurgents - said all four would be reunited with their families in the "near future", according to the Associated Press news agency.
US lawyers for the former detainees had always argued that their clients were innocent.
Wells Dixon, who worked on the case of Shawali Khan for a number of years, told BBC World TV: "They decided unanimously that he posed no threat to anyone.
"I am frankly surprised that he wasn't released many years ago."
Mr Dixon added that he expected to see more transfers from Guantanamo Bay in the near future.
President Obama seeks to eventually shut the facility.
Earlier this month, six prisoners were flown to Uruguay, which said they would enjoy complete freedom in the South American nation.
About half of the remaining inmates at Guantanamo Bay have been cleared for transfer - but many cannot be repatriated because their countries of origin are considered unstable or unsafe.
President Obama's efforts to shut the facility have also been stalled in part due to a reluctance by Congress, the BBC's Rajini Vaidyanathan reports from Washington reports.
The facility in Cuba was opened a year after the 9/11 attacks on the US.
Four Afghan prisoners in Guantanamo Bay have been sent back to their home country, the Pentagon says.