PARIS — A French family held hostage for two months by Islamist militants in West Africa has been released, French and Cameroonian officials announced on Friday.

The family members — four young boys, their mother and father and an uncle — were kidnapped in February while touring a nature reserve in the far north of Cameroon, near the Nigerian border. The Nigerian jihadist group Boko Haram, which has killed thousands in a campaign of terror in northern Nigeria, claimed responsibility for the kidnapping and demanded the release of prisoners in exchange for the hostages’ lives.

Neither African nor French officials described the conditions of the family’s release, though President François Hollande of France insisted that no ransom had been paid.

“We look for all possible contacts, we use the intermediaries that can be the most useful, but we do not cede on principles — which is the nonpayment by France of ransoms,” Mr. Hollande said at a news conference in Paris.