LIBREVILLE (Reuters) - Morocco and Gabon have signed a $2.3 billion joint-venture deal to construct fertiliser factories to serve Africa's growing agricultural market, as the North African kingdom seeks to expand its investments south of the Sahara. The deal, signed during a three-day visit by Moroccan King Mohamed VI to Libreville during a tour of the region, envisages the construction of two factories in each country, making use of Moroccan phosphates and Gabonese natural gas. Morocco's Trade Minister Moulay Hafid Alamy said the project's production capacity would reach 2 million tonnes of fertiliser a year by 2018, all destined for the sub-Saharan African market. It would create a total of 5,000 jobs in the two countries. "This deal confirms the friendly relations between Morocco and Gabon," he said at the signing late on Thursday. Morocco, which has long had strong ties with Libreville, is one of the largest African investors in the oil-rich central African country, present in the telecoms, banking, mining and shipping sectors. The deal foresees the construction of a plant in Gabon to produce ammonia from natural gas - the first of its kind in the region - and a factory to turn this into fertiliser in the oil hub of Port Gentil. Two plants producing phosphoric acid will be built in Morocco to process phosphate from the Oulad Abdoun basin, in the province of Khouribga, as well as a fertiliser plant. The agreement also foresees technology exchange between the two countries.