Germany promised Tunisia financial aid on Friday as the two countries agreed to sign an agreement to smooth the way for Berlin to deport migrants to the North African country.
Germany will give Tunisia 250 million euros (263 million dollars) to support development projects in poor areas, Chancellor Angela Merkel told a press conference held in Tunis with President Beji Caid Essebsi.
The agreements follow an attack in December in Berlin by Anis Amri, a failed Tunisian asylum seeker, who couldn't be sent back to his native Tunisia because the country didn't send passport replacement documents for him.
"We know that societies open to the world are vulnerable," Merkel said, addressing the Tunisian parliament later in the day about extremist attacks in both countries.
Amri rammed a hijacked truck into a crowded Christmas market in Berlin, killing 12 people and injured dozens.
The payment to Tunisia should be used to create jobs and fund small businesses, Merkel said.
Alongside the money transfer, Essebsi announced that both countries reached a deal regarding a repatriation agreement, which gives Tunisia the right to decide on deported asylum seekers case by case, while promising to make the process faster.
So that attacks such as that committed by Amri don't occur again, Merkel said the two countries "will execute processes more quickly" under the new deal.
"We agreed that German identification questions will be answered within 30 days," she said in parliament. "Issuing passport replacement documents will take less than one week."
Merkel said Germany also allocated 15 million euros in aid to deported Tunisians, as each will receive financial aid before being sent home.
Germany is interested in creating opportunities and chances for Tunisians before deporting failed asylum seekers, she added.
Tunisia's economy has suffered in recent years due to a decline in tourism after repeated terrorist attacks hit the country, leaving it with a high unemployment rate at around 15 per cent.
Italy and Tunisia signed an agreement in 2011 to repatriate Tunisian nationals arriving there.
Last month, Merkel proposed funding education incentives for Tunisians who voluntarily return to their home country as part of her bid to reduce migration to Germany from North African countries.
Prior to the assault, German authorities had rejected Amri's bid for asylum, but he could not be returned to Tunisia because of missing documents and bureaucratic disputes with Tunis.
The attack has increased pressure on Merkel's government to get tough and reduce number of asylum seekers.
Germany has taken in more than 1 million migrants since 2015.
On Thursday, Merkel was in Cairo for talks with Egyptian President Abdel Fattah al-Sissi, as part of a trip aimed at bolstering economic relations with North African countries and stemming migration to Germany ahead of national elections.
Egypt's Ministry of Investment and International Cooperation said on Friday that Germany has offered Egypt 500 million dollars to support the government's economic programme and small and medium businesses.
By Tarak Guizani and Nehal El-Sherif