Philip Mubiana and James Mwape, both in their early 20s, had been held since May 2013 and faced up to 15 years in jail if convicted.
The case had drawn the attention of rights groups and foreign governments, concerned that Zambia may be toughening its stance on gay rights following tough new laws in Uganda and elsewhere in Africa.
The two men were arrested after being reported to the police by one of Mubiana’s relatives.
Outside court in Kapiri Mposhi, the small town 200 kilometres (125 miles) north of Lusaka were the trial took place, several local residents denounced Western governments for their support of the couple.
In February, another Zambian magistrate acquitted top gay rights activist Paul Kasonkomona on charges of encouraging homosexuality after concluding that the prosecution failed to prove its case.