NATO says the group was freed during an overnight raid by coalition forces. They were kidnapped last week.
The four were in Afghanistan on a humanitarian mission for Switzerland-based Medair.
Coalition forces moved in for the rescue amid growing concerns for the hostages' safety.
The hostages were 26-year-old Kenyan Moragwa Oirere and 28-year-old Helen Johnston from England. Officials said the rescue operation was carried out by British troops in cooperation with other NATO and Afghan forces.
All four hostages were rescued safely, no British troops were injured and a number of Taliban militants and kidnappers were killed, authorities said.
The Associated Press contributed to this report.