African officials pledged to create a free-trade zone across half of the continent, a bold commitment to dismantle long-standing hurdles to investment in the fast-growing but fragmented region.

Leaders from 26 countries across Africa’s eastern half from Egypt to South Africa agreed Wednesday to work toward a free-trade zone that would remove tariffs and customs between them.

Their...