German Chancellor Angela Merkel on Tuesday urged more investment in African countries to improve their living standards and help prevent migrants from coming to Europe as part of the Compact with Africa initiated through the G20.

Meeting with several African leaders and international partner organizations, Merkel said that “we should do everything to cooperate with Africa, not to talk about Africa but to do something together.”

She welcomed Egyptian President Abdel Fattah Al-Sisi along with leaders from Ethiopia, Benin, Ghana, Morocco, Tunisia and elsewhere.

Stefan Liebing, left, chairman of the German'African Business Association (Afrika-Verein der deutschen Wirtschaft), Heinz-Walter Grosse, second from right, chairman of the Sub-Saharan Africa Initiative of German Business (SAFRI) and Michael Blank, right, chairman of AHK Ghana (Delegation of German Industry and Commerce in Ghana), pose with Ghana's President Nana Akufo-Addo, 2nd from left, as he arrives to attend the "G20 Investment Summit - German Business and the CwA Countries 2019" on the sidelines of a Compact with Africa (CwA) in Berlin on November 19, 2019. (John MacDougallPool via AP)

Stefan Liebing, left, chairman of the German'African Business Association (Afrika-Verein der deutschen Wirtschaft), Heinz-Walter Grosse, second from right, chairman of the Sub-Saharan Africa Initiative of German Business (SAFRI) and Michael Blank, right, chairman of AHK Ghana (Delegation of German Industry and Commerce in Ghana), pose with Ghana's President Nana Akufo-Addo, 2nd from left, as he arrives to attend the "G20 Investment Summit - German Business and the CwA Countries 2019" on the sidelines of a Compact with Africa (CwA) in Berlin on November 19, 2019. (John MacDougallPool via AP)

Both Europe and Africa will profit from European investment but more transparency in Africa is essential so that German companies will have enough trust to invest there, Merkel said.

Instability and extremism, especially in the Sahel region, also keep Western countries from further investment in Africa, she said.

Africa is “a continent with more opportunities than risks but there’s still a lot to do,” Merkel told ARD public television.

Stefan Liebing, left, chairman of the German'African Business Association (Afrika-Verein der deutschen Wirtschaft), and Heinz-Walter Grosse, right, chairman of the Sub-Saharan Africa Initiative of German Business (SAFRI), pose with Egypt's President Abdel Fattah al-Sisi, center, as he arrives to attend the "G20 Investment Summit - German Business and the CwA Countries 2019" on the sidelines of a Compact with Africa (CwA) in Berlin on November 19, 2019. (John MacDougallPool via AP)

Stefan Liebing, left, chairman of the German'African Business Association (Afrika-Verein der deutschen Wirtschaft), and Heinz-Walter Grosse, right, chairman of the Sub-Saharan Africa Initiative of German Business (SAFRI), pose with Egypt's President Abdel Fattah al-Sisi, center, as he arrives to attend the "G20 Investment Summit - German Business and the CwA Countries 2019" on the sidelines of a Compact with Africa (CwA) in Berlin on November 19, 2019. (John MacDougallPool via AP)

The Compact with Africa was initiated in 2017 during Germany’s presidency of the Group of 20 industrialized and developing nations. Twelve African countries have joined the initiative: Benin, Burkina Faso, Ivory Coast, Egypt, Ethiopia, Ghana, Guinea, Morocco, Rwanda, Senegal, Togo and Tunisia.

Working with the World Bank, International Monetary Fund and the African Development Bank, the goal is to bring about the conditions in African countries needed to attract private investment. Those include economic stability and protection for investments by fighting corruption.

Europe and Africa face many common challenges such as climate change, digitization and migration that need to be tackled together, Merkel said.

Stefan Liebing, left, chairman of the German'African Business Association (Afrika-Verein der deutschen Wirtschaft), and Heinz-Walter Grosse, right, chairman of the Sub-Saharan Africa Initiative of German Business (SAFRI), pose with Burkina Faso's President Roch Marc Christian Kabore, center, as he arrives to attend the "G20 Investment Summit - German Business and the CwA Countries 2019" on the sidelines of a Compact with Africa (CwA) in Berlin on November 19, 2019. (John MacDougallPool via AP)

Stefan Liebing, left, chairman of the German'African Business Association (Afrika-Verein der deutschen Wirtschaft), and Heinz-Walter Grosse, right, chairman of the Sub-Saharan Africa Initiative of German Business (SAFRI), pose with Burkina Faso's President Roch Marc Christian Kabore, center, as he arrives to attend the "G20 Investment Summit - German Business and the CwA Countries 2019" on the sidelines of a Compact with Africa (CwA) in Berlin on November 19, 2019. (John MacDougallPool via AP)

Germany, which took in more than one million migrants in 2015 and 2016, has been leading European efforts to prevent another surge with a strategy that includes focusing on development aid and other support to address the root causes that prompt people to flee their home countries.

Several global powers are pushing hard to exert more influence in Africa, taking advantage of the seemingly waning U.S. interest in the continent under President Donald Trump’s administration.

In October, Russian President Vladimir Putin courted more than 40 African leaders at the first-ever Russia-Africa summit, hailing the continent's "enormous potential for growth" and negotiating deals to tap its riches including diamonds, uranium and oil.

Stefan Liebing, left, chairman of the German'African Business Association (Afrika-Verein der deutschen Wirtschaft), and Heinz-Walter Grosse, right, chairman of the Sub-Saharan Africa Initiative of German Business (SAFRI), pose with Prime Minister of Togo Komi Selom Klassou, center, as he arrives to attend the "G20 Investment Summit - German Business and the CwA Countries 2019" on the sidelines of a Compact with Africa (CwA) in Berlin on November 19, 2019. (John MacDougallPool via AP)

Stefan Liebing, left, chairman of the German'African Business Association (Afrika-Verein der deutschen Wirtschaft), and Heinz-Walter Grosse, right, chairman of the Sub-Saharan Africa Initiative of German Business (SAFRI), pose with Prime Minister of Togo Komi Selom Klassou, center, as he arrives to attend the "G20 Investment Summit - German Business and the CwA Countries 2019" on the sidelines of a Compact with Africa (CwA) in Berlin on November 19, 2019. (John MacDougallPool via AP)

Russia was following the lead of China, which has invested hundreds of billions of dollars in infrastructure and other projects across Africa in recent years.