The two men -- Salem Abdu Salam Ghereby, 55, and Omar Khalif Mohammed Abu Baker Mahjour Umar, born in 1972 -- had been in the controversial US military jail since 2002.
Both had ties to the Libyan Islamic Fighting Group and Al-Qaeda, according to their leaked prisoner files.
"The United States is grateful to the government of Senegal for its humanitarian gesture and willingness to support ongoing US efforts to close the Guantanamo Bay detention facility," the Pentagon said in a statement.
President Barack Obama in February presented Congress with a new plan to close Guantanamo, which he says serves only to stoke anti-US resentment and fuel jihadi recruitment.
Also Read
But Republican lawmakers firmly oppose the jail's closure, especially because Obama wants to transfer the highest-risk detainees to a site in the United States, so his plan is likely doomed.
"The administration is determined to close the Guantanamo Bay detention facility. The continued operation of the detention facility weakens our national security by draining resources, damaging our relationships with key allies and partners, and serving as a propaganda tool for violent extremists," Secretary of State John Kerry said in a statement.
"This significant humanitarian gesture is consistent with Senegal's leadership on the global stage," Kerry said.