Alexander John-Robert Drueke, left, and Andy Tai Ngoc Huynh, right.
CNN  — 

Two American veterans and five British citizens who had been held by Russian-backed forces for months have been released as part of the prisoner swap between Russia and Ukraine that was brokered by Saudi Arabia.

Family members of Americans Alexander John-Robert Drueke and Andy Tai Ngoc Huynh, who were captured in June while fighting for Ukraine north of Kharkiv, confirmed they had been freed. British Prime Minister Liz Truss tweeted that five British citizens had been released. Additionally, three prisoners who are Moroccan, Swedish and Croatian nationals were released in the swap, the Saudi Ministry of Foreign Affairs said.

“Hugely welcome news that five British nationals held by Russian-backed proxies in eastern Ukraine are being safely returned, ending months of uncertainty and suffering for them and their families,” Truss said.

Drueke’s aunt released a statement confirming the release of her nephew, 39, from Tuscaloosa, Alabama, and Huynh, 27, of Hartselle, Alabama.

“We are thrilled to announce that Alex and Andy are free. They are safely in the custody of the US embassy in Saudi Arabia and after medical checks and debriefing they will return to the States. We deeply appreciate everyone’s prayers and especially the close communication and support of our elected officials, Ukrainian Ambassador Markarova, and our members of the US embassies in Ukraine and Saudi Arabia and the US Department of State,” said Diana Shaw, a spokesperson for both families and Dreuke’s aunt.

The families did not know that the prisoner exchange was in the works.

The Saudi Ministry of Foreign Affairs said in a statement that the 10 freed prisoners were “released as part of an exchange of POWs between Russia and Ukraine” and taken to Saudi Arabia.

CNN previously reported that the two Americans were captured during a battle near Kharkiv. Their pro-Russian captors, the so-called Donetsk People’s Republic (DPR), is a Russian-backed, self-declared republic that has governed a breakaway portion of Ukraine’s Donetsk region since 2014.

Bunny Drueke, Alexander’s mother, and Huynh’s fiance, Joy Black, told CNN in June that selflessness and a love for the US fueled their loved ones’ decision to go to Ukraine.

“He is one of the most loyal Americans you would ever hope to meet and he was proud to serve his country,” Drueke said of her son. “He said, ‘Mom, I really need to go and help fight in Ukraine because if Putin is not stopped there he is not going to be satisfied, he will become emboldened and eventually Americans will be threatened.’”

Black said at the time that her fiancé “didn’t go there for selfish reasons or anything. He really had this gnawing at his heart and this big burden on him to go and serve the people however he can.”

This story had been updated with additional details Wednesday.

CNN’s Devan Cole contributed reporting