Information Minister Lai Mohammed said the release was "unconditional" and the result of "back-channel efforts" with the help of "some friends of the country", without elaborating.
"The 76 are those who have been documented so far," he said, adding that they were released at about 3:00 am (0200 GMT) and that a full head-count was under way.
Nigeria's President Muhammadu Buhari said last week the government had "chosen negotiation" to secure the return of the Dapchi girls rather than use military force.
Mohammed said: "For the release to work, the government had a clear understanding that violence and confrontation would not be the way out as it could endanger the lives of the girls, hence a non-violent approach was the preferred option.
"Within the period when the girls were being brought back, (an) operational pause was observed in certain areas to ensure free passage and also that lives were not lost."
Nigeria's presidency said separately that the girls were in the custody of the country's intelligence agency, the Department of State Services.
Five Died En Route
The Dapchi kidnapping on February 19 brought back painful memories of a similar abduction in Chibok in April 2014, when more than 200 girls were taken.
Aisha Alhaji Deri, a 16-year-old student who was among those kidnapped in Dapchi, told reporters they were not mistreated during their time in captivity.
But she added: "When we were being taken away, five of us died on the way.
"They brought us back this morning, dropped us outside the motor park and said we should all go home and not go to the military because they will claim to have rescued us."
Parents earlier told AFP that the girls were brought back to Dapchi in nine vehicles at about 8:00 am. Some of the students headed to their homes in surrounding villages.
Bashir Manzo, who heads a parents' support group in Dapchi, said: "These girls were not accompanied by any security personnel.
Parents in the remote town said the girls had been taken for medical check-ups after their ordeal and that security was tight in the town.
Boko Haram has used kidnapping as a weapon of war during its nearly nine-year insurgency which has claimed at least 20,000 lives and made more than two million others homeless.
The Islamic State (IS) group affiliate has not claimed responsibility for the abduction but it is understood that a faction headed by Abu Mus'ab al-Barnawi was behind it.
In August 2015, IS publicly backed Barnawi as leader of Boko Haram, or Islamic State West Africa Province, over Abubakar Shekau, whose supporters carried out the Chibok abduction.
Analysts have attributed a financial motive to the Dapchi kidnapping given government ransom payments made to Boko Haram to secure the release of some of the captives from Chibok.
On Tuesday, Amnesty International claimed that the military ignored repeated warnings about the movements of Boko Haram fighters before the kidnapping.
The military rejected the allegation, calling it an "outright falsehood".
Similar claims were made about the hours leading up to the Chibok abduction, which brought sustained worldwide attention on the conflict for the first time.
The Chibok abduction also triggered a global campaign for their release, spearheaded by the US former first lady Michelle Obama. There was no similar campaign for the Dapchi girls.
Since May 2016, 107 Chibok girls have escaped, been found or been released as part of a government-brokered deal with the jihadists.
(Except for the headline, this story has not been edited by NDTV staff and is published from a syndicated feed.)