They reached Dhaka on a Turkish Airlines flight on Wednesday, according to foreign ministry officials.
The six had boarded the Dhaka-bound flight from Malaga on Tuesday, the Bangladesh Embassy in Madrid had previously said in a statement.
After being rescued by the US Army in Afghanistan, they were first taken to Saudi Arabia's Riyadh on Aug 28. Two days later, they were stationed at Spain's Rota Military Base under the supervision of the US Army.
The government, with the help of the Bangladesh mission in Spain, maintained close contact at the diplomatic level with the US embassy, the US military and the Spanish foreign ministry to facilitate their return home, according to the statement.