The Nigerian government agreed to transfer Bakassi two years ago in line with a 2002 International Court of Justice (ICJ) order but violence, political disputes and legal skirmishes had delayed it. About 50 people have been killed in border fighting in the last year alone.
Analysts said Cameroon will have to confront the deteriorating security situation before it can begin to exploit the region's offshore oil reserves.
"We are saddled with the painful, but important task of completing the implementation of the International Court of Justice's judgement by handing the Bakassi peninsula to Cameroon," said Nigeria's Justice Minister Michael Aondoakaa at the formal signing ceremony.
Heightened security concerns in Bakassi forced organisers to cancel a flag-exchanging ceremony at the peninsula's main town Abana, relocating it instead to a safer venue in Calabar city, some 192 km (120 miles) away.
Security sources say there are several unrelated armed groups in Bakassi, fighting for independence, money, housing and other causes.
SECURITY FIRST, OIL LATER
The two African countries, which nearly went to war over Bakassi on several occasions, have agreed to work together to explore for oil in the region, which could help boost Cameroon's declining production of around 90,000 barrels per day.
"I don't think Cameroon will be in a hurry to exploit Bakassi's oil reserves since the security situation remains a great concern," said Nnamdi Obasi, senior analyst for Crisis Group.
Around 90 percent of the population in the Bakassi peninsula, estimated at 200,000 to 300,000, are Nigerian fishermen and their families.
Bakassi leaders and Nigerian lawmakers say they do not want to become Cameroonians. Nigeria has offered to resettle them.
The Niger Delta Defence and Security Council, a little-known armed group responsible for two attacks on Cameroonian soldiers last month, promised more violence.
"Our struggle will continue until our demands are met -- whether it be from the Nigerian government or Cameroon," said Commander Ebi Dari, the group's spokesman. He declined to elaborate on what the group's demands were.
Nigeria and Cameroon fought over Bakassi in 1994 when Cameroon first took its case to the World Court, and again in 1996. The ICJ gave Bakassi to Cameroon in a 2002 ruling, based largely on a 1913 treaty between former colonial powers Britain and Germany.