Djibouti's foreign ministry announced on Wednesday that deputies of the opposition Union for National Salvation (USN) would "return" to their eight seats in the National Assembly.
The USN has avoided parliament since accusing the government of rigging February 2013 elections. That was the first time the opposition had won any seats since multiparty politics was introduced in 1992.
The ministry said the "historic agreement" was signed on Wednesday by Prime Minister Abdoulkader Kamil and USN leader Ahmed Youssouf after 18 months of negotiations.
Also present during the signing was President Ismael Omar Guelleh who has strong links with Kamil's governing Union of Presidential Majority (UMP) party.
More negotiations ahead
USN official Maki Houmed Gaba said the deal was preliminary and confirmed that his party would take up eight seats in the 65-member parliament.
"We are happy with this accord, but it's a framework - we have to wait for a definitive deal and be sure that the promises are met," Gaba said.
The ministry's statement added that a commission comprising the governing UMP and the USN would work on a "definitive accord."
Its agenda would include democratic reforms, the status of the opposition and a reform of the small nation's electoral commission, it said.
France welcomes deal
Former colonial ruler France welcomed the deal and urged Djibouti's political parties to regard the deal as a bid to "restore democracy and the rule of law."
Djibouti hosts the United States' only military base in Africa and is an ally in the West's fight against militant Islam.
The territory is also used by foreign navies patrolling busy shipping lanes in the Gulf of Aden to fight piracy. The key port at the juncture of the Red Sea and Gulf of Aden also serves landlocked Ethiopia.
Djibouti also contributes troops to the African Union force in neighboring Somalia which battles al-Qaeda-linked al-Shabab militants.
Sources -Deutsche Welle